How to Setup Passwordless SSH

You may have hosts that you SSH into often and you get tired of typing password every time. You can skip typing password by having hosts remember your public key.

Make sure you’ve already created key pair by using ssh-keygen on your client machine, which generates id_rsa (private key) and id_rsa.pub (public key) under ~/.ssh directory.

Next, execute the following command to have the host remember your public key.

 cat ~/.ssh/id_rsa.pub | ssh amaterasu48@linux-mint 'cat >> .ssh/authorized_keys'

The command above writes out the public key generated on the client machine to the remote hosts’s ~/.ssh/authorized_keys file. If you just try to SSH into the host again, you won’t be promoted to enter password again.

ssh amaterasu48@linux-mint

This is how you can setup passwordless SSH!

Author: admin

A software engineer in greater Seattle area

Leave a Reply

Your email address will not be published. Required fields are marked *