SSH Public Key login

This topic has been covered on many sites, but I want to document it for myself so I can find it back easily

We use the ssh-keygen utility to generate a RSA key pair. The private key is saved in ~/.ssh/id_rsa with no passphrase and the public key is saved in ~/.ssh/id_rsa.pub/

server1:~/ssh # ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
50:fe:4f:cb:5a:8f:44:53:7c:9c:7f:e1:c9:99:db:bd root@server1

Now you have to copy the content of the id_rsa.pub to the ~/.ssh/authorized_keys of the user on the host you want to connect to.

Now you can login without a password.

About Michael
Michael Wilmsen is a VMware training/consultant (no specific order) with more than 15 years in the IT industry. Main focus is VMware vSphere, Horizon View and Site Recovery Manager with a deepdive to performance. Michael is VCDX 210, VCAP 4/5 certified, has been rewarded with the vExpert title from 2011, is a PernixPro, Nutanix Tech Champion and a Nutanix Platform Professional.

2 Comments to “SSH Public Key login”

  • » Automatic documentation of your SLES/OES2 server — July 8, 2009 @ 14:36

  • » Automatic documentation of your SLES/OES2 server — July 8, 2009 @ 14:36

  • RSS feed for comments on this post. TrackBack URI

    Leave a Reply

    You must be logged in to post a comment.