Save 2 seconds of your time by setting up an SSH key

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)

1
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:

1
2
Host *
  IdentityFile ~/.ssh/id_rsa

Step 3:

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

1
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

Get new posts by email:

Comments

Hint: To type code with Disqus, use
<code><pre>insert.code.here()<pre/><code/>
2023-03-03