rsync with script supplied password
Solution 1:
Have you looked at using expect?
Solution 2:
Look for the program sshpass
in your distribution. Once you have it, you can do:
rsync –e 'sshpass -f passwordfile ssh -l user' host:path
or, putting everything in one file:
rsync –e 'sshpass -d 300 ssh -l user' host:path 300<<<'password'
You might want to look into changing the AuthorizedKeysFile
option in the remote server's sshd_config
, if that's an option, so you may have your public key set up there without a home directory. In that case, it would be something like /home/%u/.ssh/authorized_keys
, to minimize potential conflicts with other users on the system.