There are several reasons that you might want to generate SSH key for login without password
- When you need daily login to different linux systems through the SSH many times and you feel annoying in entering the password every time.
- There are services/programs use SSH for connecting between the systems. For instance, rsync and lsyncd for file replication.
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.