Skip to content

How To: SSH key exchange

cpx August 7, 2008 1 min read GNU/Linux

First you’ll need to generate your local public key. This is the public end of a local public / private pair that you’ll share with the remote machine to identify you.

ssh-keygen -t dsa (on your local machine)

Second you’ll need to copy this key to the remote machine using a command such as:

scp ~/.ssh/id_dsa.pub [email protected]:

Lastly, log into the remote machine via ssh (using your password for the last time!) and use this command to add the newly generated key to the list of authenticated keys:

cat id_dsa.pub >> .ssh/authorized_keys

You’ll also probably want to delete the original key as well.

rm id_dsa.pub

At this point a copy of your key is now stored on the remote machine as an authorized keys and any ssh connection coming from the local machine will match that key and connect with the key authentication instead of a password. So nice.

0 0 votes
Article Rating
guest

0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x