Linux tips and tricks for faster and easier administration Linux servers and applications! Troubleshooting and solutions!

Wednesday, 27 August 2014

ssh login to another server with no login using rsa keys

After you created rsa key, it is time to exchange them with server that you want to connect with no password.

Use this command

root@ubuntus1:~/.ssh# ssh-copy-id -i id_rsa.pub root@192.168.1.2The authenticity of host '192.168.1.2 (192.168.1.2)' can't be established.ECDSA key fingerprint is 48:ea:a4:f7:12:15:ca:f0:53:c6:66:44:e8:6b:30:8f.Are you sure you want to continue connecting (yes/no)? yes/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompt ed now it is to install the new keysroot@192.168.1.2's password:

Number of key(s) added: 1

Now try logging into the machine, with: "ssh 'root@192.168.1.2'"and check to make sure that only the key(s) you wanted were added.