configure passwordless SSH login

STEP ONE – Generating the key pair

1) Generate an RSA private key using ssh-keygen (unless you have already created one).

 ssh-keygen -t rsa

This creates a public/private keypair of the type (-t) rsa.

 Generating public/private rsa key pair.
Enter file in which to save the key (/Users/YOUR-USER-HERE>/.ssh/id_rsa):

Once the keypair is created, you are prompted to enter the following items.

2) Click Enter on your keyboard to continue.

 Enter passphrase (empty for no passphrase): 

3) Click Enter (AGAIN) on your keyboard to continue.

 Enter same passphrase again (empty for no passphrase): 

4) Click Enter on your keyboard to continue.

5) When finished, click Enter on your keyboard.

STEP TWO – Copying the public key you just created on your home computer to your server

1) Run the following command to copy the public key on your local computer to server.

cat ~/.ssh/id_rsa.pub | ssh username@yourserver.com "mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys"

STEP THREE – Confirming the SSH connection

ssh username@yourserver.com

***Notes taken from this post

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.