Connect one server to another without retyping the password

April 17, 2017 0 By Renan W. Silva

Use ssh-keygen on the local server to generate public and private keys.


Note:   When prompted to enter the phrase, press Enter and do not enter any passwords here.

Use ssh-copy-id to copy the public key to the remote server.

ssh-copy-id -i ~/.ssh /

Note:   The above will prompt you for the password of your account on the remote host and copy the public key automatically to the appropriate location [previous IP number corresponding to the IP of the remote server].

Ready. This is quite useful even to transfer files by cronjob with rsync over ssh.

connect-server [1]