I am copying files from a remote server to my local server. Here is the code that does this:
ssh -q username@$192.168.162.156 "su -lc 'cp /copy/from /copy/it/here'"
I am using this code segment in a for loop so it will prompt for a password for every iteration. How do I get the password from the su
command? (without using rsync or sudo). I also don't want any alternatives even if they are better.