SSH Login No Password

Logos

To enable ssh login to other hosts on your network is pretty simple to set up. Generate a public key using ssh-keygen and copy the key to the hosts you want to access without a password. It that simple.

Here's how to do it:

1. Generate a public/private rsa key pair

ssh-keygen -t rsa

2. Give file location to save key. Accept default.

Press [enter]

3. Enter password for the keyPress [enter]

4. Enter same password:Press [enter]

Your identification has been saved in /home/patrick/.ssh/id_rsaYour public key has been saved in /home/patrick/.ssh/id_rsa.pub.

5. Copy your public key.

Caution. Make sure you copy the right key. When ssh-keygen runs, it creates two keys: id_rsa.pub and id_rsa.

Id_rsa.pub is the public key. The one you share. The second key, id_rsa (no .pub extension) is your private key. If you copy the wrong key to the remote host, connection without password will not work.

You're in with no password. If not, you carried out one of the steps wrong. Go back and check the id_rsa.pub matches the copy. Check the file is in the correct location: ~/.ssh. Check the file is correctly named: authorized_keys.

Added Bonus

Aside from being able to log in with no password, you can also copy files without needing to authenticate yourself.