I want to set up an RSync job that would connect through SSH.
I have my computer ( backup@myhost ) and the remote host ( test@remhost ) and I need to backup the folder ~/something with all it's contents. The ssh user test only has READ access to all files and folders in the ~/ folder. I want to use rsync to copy the test@remhost:~/something folder to the backup@myhost:~/bak folder.
For this purpose I use the following command via BASH on Ubuntu 11.10 (Oneiric):
rsync -avz -e ssh test@remhost:~/something/ ~/bak/
After hitting enter I get this:
I type the password and the rsync works.
I want to make the above command to automatically input the password and pass it as a parameter or to input it automatically and start the job.
I tried executing
rsync -avz -e ssh test:password@remhost:~/something/ ~/bak/ but it still asks for the password and it's annoying.
I don't want to hear about any kind of keys (RSA,DSA or any other). I just want a simple command that would log me in and do the job.
EDIT: A possible scenario could be, if public key authentication is disabled and you can't change this. E.g. if you use OpenSSH, you'd need root privileges on the server in order to edit the file
sshd_config and to add
EDIT: This is what finally worked for me:
sshpass -p 'sshpassword' rsync --progress -avz -e ssh test@remhost:~/something/ ~/bak/
Please note that this method is not considered secure as it sends the password in plain text and it's vulnerable to man-in-the-middle attacks. It is advised to use the key athentication for a stronger security.