Passwordless ssh for rsync, etc.
First you need to generate an RSA key on the source server.
ssh-keygen -t rsa
By default, the following files are created: /root/.ssh/id_rsa and /root/.ssh/id_rsa.pub.
Go to /root/.ssh/ and rename the files to the following format:
id_rsa –> server_prv_key and id_rsa.pub –> server_pub_key (where “server” is the hostname)
Next copy the contents across to destination server
Copy contents of server_pub_key and paste it into the /root/.ssh/authorized_keys on the destination server.
Now you can ssh without a password from one machine to another
ssh -p 10022 -i "/root/.ssh/server_prv_key" root@destination
No comments yet.