Configure SSH Key-Based Authentication

SSH with key based authentication allows you to log on different servers via the personal private key on all servers, needing not to remember several passwords.

SSH key pairs are two secure keys that can be used to authenticate a client to an SSH server. Each key pair consists of a public key and a private key.

ssh key authentication

Step 1 Generating RSA / DSA Key Pairs
To generate an RSA key pair for version 2 of the SSH protocol:

To generate an DSA key pair for version 2 of the SSH protocol:

it will generate key pairs under ~/.ssh/. The private key is in id_rsa, and id_rsa.pub has a public key

Step 2 Change the permissions of the ~/.ssh/ directory

Step 3 add/update authorized_keys
Copy the content of ~/.ssh/id_rsa.pub into the ~/.ssh/authorized_keys on the server you want to connect.

Step 4 Change the permissions of the ~/.ssh/authorized_keys

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on RedditShare on StumbleUponEmail this to someoneShare on TumblrDigg this

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">