July 11, 2014

Generate SSH Key for login without password in Ubuntu and Linux

There are several reasons that you might want to generate SSH key for login without password

  1. When you need daily login to different linux systems through the SSH many times and you feel annoying in entering the password every time.
  2. There are services/programs use SSH for connecting between the systems. For instance, rsync and lsyncd for file replication.

Check the steps below to create passwordless SSH login !

Assume that you have 2 servers (master server and salve server), and would like connect salve server from master server using SSH without enter password.

1. Create a SSH key in master server using this command to create RSA keys.


ssh-keygen -t rsa

2. Copy the generated SSH key from master server to salve server.


ssh-copy-id username@host

3. Access the salve server from master server.


ssh username@host

With the steps above, you are created a passwordless SSH login successfully.

No comments:

Post a Comment