[olug] SSH public/private keys

Eric Penne epenne at olug.org
Tue Nov 11 21:46:53 UTC 2003


Here is a little howto on using ssh without a password to log in to places.

In this case I am using my home PC from my own account so that other
people can't use my account to log into other PCs.

from my home directory I run:

ssh-keygen -t dsa

It asks where to save the file and i say /home/epenne/.ssh/id_dsa

it then asks for a passphrase and to repeat the passphrase.

Then it generates the key.  In my home directory I have .ssh/id_dsa and
.ssh/id_dsa.pub.  I want to put the id_dsa.pub on the computer I will log
in to in this case olug.org.

scp .ssh/id_dsa.pub epenne at olug.org:.ssh/

I then log into olug.org and mv the file .ssh/id_dsa.pub to
.ssh/authorized_keys.

If authorized_keys is already present then I append the id_dsa.pub file to
authorized_keys.

I log off of olug.org then I try to log back into olug.org and presto! I
don't need a password.

Back to security.  Remember that you don't want to leave the account that
has your private key (.ssh/id_dsa) open to anybody or they could use that
to login to the server without the password.  You should probably
periodically change these keys.  It isn't that hard and it saves a lot of
typing if you login to a certain machine many times.

Eric Penne




More information about the OLUG mailing list