December 19, 2008

Set up ssh key pairs

0  comments

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):


Tags

Linux, scp, ssh, sshkeypairs


You may also like

Leave a Reply

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

Information about Data protection

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

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}