System Administration & Network Administration
linux ssh rsync ssh-keys ssh-keygen
Updated Tue, 02 Aug 2022 15:59:14 GMT

rsync without password, none of google (server fault) tutorials worked


I need to use rsync for a daily backup operation and in the past (on different servers) I managed to just use a rsa key etc, but now none of google (serverfault) tutorials work at all.

It keeps asking me for a password.

I have webmin and ssh/root access to both servers.

My steps:

  1. create a key on server 1
  2. send key.pub to server 2
  3. add key.pub to .ssh/authorized_keys
  4. chmod 700 .ssh/authorized_keys
  5. go back to server 1 and try rsync and it keep asking for password...

rsync command: rsync -avz -e ssh file.txt root@server2:/root

EDIT: well, I cleaned up everything and this time, instead of inserting a custom name to the key I used the standard one on server1. sent the .pub to server2 and it worked as a charm... So the answer is that server1's ssh wasn't even using the right key...




Solution

The solution is to use the standard name during key creation. All other steps kept the same and it worked like a charm.





Comments (1)

  • +0 – You may specify what key to use, as explained in my comment on other answer. — Dec 19, 2012 at 11:16