Set up ssh key pairs

Posted by Jens Jäger on December 19, 2008

With ssh key pairs you can easier login to your servers.

To generate an ssh key pair you´ll need to run the following line in your terminal:

It will ask you for location and pass phrase. You should accept the default location (~/.ssh/id_dsa.pub). For the pass phrase I usually just press return. Then the private key will have a blank pass phrase and you can login to your servers without a password. Comfort vs. security. Your choice.

After this you need to upload the public key to the server.

Finally login to the server and append the public key to authorized keys:

Make sure that the .ssh folder and the authorized_keys have the right permissions:

After this, you should be able to login to the server and use scp without having to enter a password.

If you login or copy files to your servers a lot, you can setup an alias in ~/.ssh/config (on your local machine):

Trackbacks

Use this link to trackback from your own site.

Comments

Leave a response

Comments

Information about Data protection