Skip to content

Passwordless SSH between systems that share a /home

Just thought I'd share this nugget of knowledge with you all. If you work on linux systems that share a /home directory, that may be NFS-mounted across several other systems, then you can take advantage of this so you don't have to enter your password every time you ssh between the linux systems. 

Here is how to set that up

Step 1:

Make sure you have ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub (or another key you want to use instead with a different name)

ssh-kegen # command to generate a key for yourself
 

Step 2:

Make sure your ~/.ssh/config file is configured to use your ~/.ssh/id_rsa by default   Example ~/.ssh/confg file:

Host *
   IdentityFile ~/.ssh/id_rsa
 

Step 3:

Make sure your ~/.ssh/id_rsa.pub contents is also in ~/.ssh/authorized_hosts

cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_hosts # appends line to end
 

Finally:

Now you can ssh without a password between all systems that share a /home