Apr 10, 2011

How to generate an SSH key in Linux?

You can generate a key in Linux using the ssh-keygen command. You should run it in the command line. You will be asked for a file in which the key should be saved to and for a passphrase (password) for the key:

user@localhost: ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_dsa.
Your public key has been saved in id_dsa.pub.
The key fingerprint is:
12:9e:e9:f3:4d:c9:b9:cf:43:9a:b2:2c:c4:1f:45:72 user@localhost

This will create a private key written to /home/user/.ssh/id_dsa and a public key written to /home/user/.ssh/id_dsa.pub. The passphrase is used to protect your key. You will be asked for
it when you connect via SSH.

0 comments:

Post a Comment

 

Copyright © 2011 Best WebHosting Tips | Design by Kenga Ads-template