How to setup passwordless ssh
-
Check whether you have a public RSA key to share on your local computer. This means that you should have a file named
~/.ssh/id_rsa.pub
. If so, skip next step. -
If you don't have a public RSA key, generate one using the following command accepting all default suggestions by pressing
Enter
: -
Create a profile for the remote computer on your local computer by adding the following to your
~/.ssh/config
file. Create this file if it does not exist. Note that you need to know the IP address of the remote machine you are logging onto (Can be gotten by typinghostname -I
on the remote machine). Replace the machine name (anything you want), username and IP address below as appropriate. -
Create a
~/.ssh
directory on the remote computer if it does not exist already (You can log on once with password a check if this directory exists). If this directory exists, skip this step. ReplaceREMOTE
below with the name of the computer you are logging onto (that one you gave in theHOST
field above). -
Send your public RSA key to the remote computer. Replace
REMOTE
below with the name of the computer you are logging onto (that one you gave in theHOST
field above). -
Now you should be able to do
ssh REMOTE
and login without a password.