Difference between revisions of "Public key authentication"

From Linuxintro
imported>ThorstenStaerk
imported>ThorstenStaerk
Line 1: Line 1:
With Linux, it is possible to log in to a remote computer without having to type a password. You authenticate yourself with your "digital signature" and your public key. Let's say you are on computer ''earth'' and want to log in to ''mars''. Start creating a public/private key pair:
+
With Linux, it is possible to log in to a remote computer without having to type a password. You authenticate yourself with your "digital signature" and your public key. Let's say you are ''root'' on computer ''earth'' and want to log in to ''mars''. Start creating a public/private key pair:
 
  ssh-keygen -t dsa
 
  ssh-keygen -t dsa
 
  Generating public/private dsa key pair.
 
  Generating public/private dsa key pair.
Line 8: Line 8:
 
  Your public key has been saved in /root/.ssh/id_dsa.pub.
 
  Your public key has been saved in /root/.ssh/id_dsa.pub.
 
  The key fingerprint is:
 
  The key fingerprint is:
  b7:b4:64:73:ef:4e:8a:df:d2:8c:16:ca:df:08:48:ec root@''earth''
+
  b7:b4:64:73:ef:4e:8a:df:d2:8c:16:ca:df:08:48:ec ''root''@''earth''
 +
copy your public key to ''mars'':
 +
scp /root/.ssh/id_dsa.pub root@mars:/root/.ssh/authorized_keys
 +
Now you can securely login without having to give your password.

Revision as of 06:38, 18 October 2008

With Linux, it is possible to log in to a remote computer without having to type a password. You authenticate yourself with your "digital signature" and your public key. Let's say you are root on computer earth and want to log in to mars. Start creating a public/private key pair:

ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
b7:b4:64:73:ef:4e:8a:df:d2:8c:16:ca:df:08:48:ec root@earth

copy your public key to mars:

scp /root/.ssh/id_dsa.pub root@mars:/root/.ssh/authorized_keys

Now you can securely login without having to give your password.