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 root@
The authenticity of host ' (' 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 keys
root@'s password:

Number of key(s) added: 1

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

Try to connect!

root@ubuntus1:~/.ssh# ssh
Welcome to Ubuntu 12.04.4 LTS (GNU/Linux 3.5.0-23-generic i686)

 * Documentation:

  System information as of Wed Aug 27 08:46:14 CEST 2014

  System load:  0.13              Processes:           80
  Usage of /:   65.3% of 2.71GB   Users logged in:     1
  Memory usage: 47%               IP address for eth1:
  Swap usage:   1%

  Graph this data and manage this system at:

58 packages can be updated.
44 updates are security updates.

New release '14.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

For more information, please see:

To upgrade to a supported (or longer supported) configuration:

* Upgrade from Ubuntu 12.04 LTS to Ubuntu 14.04 LTS by running:
sudo do-release-upgrade


* Install a newer HWE version by running:
sudo apt-get install linux-generic-lts-trusty linux-image-generic-lts-trusty

and reboot your system.

Last login: Tue Aug 26 14:50:48 2014 from
root@ubuntu:~# exit
Connection to closed.

As you can see, this is very simple and easy.

No comments: