Skip to content
Blog How to generate a SSH key in Linux ( ubuntu debian fedora)

How to generate a SSH key in Linux ( ubuntu debian fedora)

To generate a SSH key pair use the command ‘ssh-keygen’.

$ ssh-keygen -t dsa

This will ask you to enter a file to save the key. The default is ‘.ssh/id_dsa’ in your home directory.

Generating public/private dsa key pair.

Enter file in which to save the key (/home/dipin/.ssh/id_dsa):


 Press ‘Enter’ to accept the default.
Now it will ask for a passphrase and will ask you to re-enter to confirm.

Generating public/private dsa key pair.
Enter file in which to save the key (/home/dipin/.ssh/id_dsa): /tmp/key
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /tmp/key.
Your public key has been saved in /tmp/key.pub.
The key fingerprint is:
8d:f7:d8:d1:b6:ea:c2:a7:a4:fd:ff:6f:95:06:bb:0a dipin@dipinkrishna.info


You will get a private key file and a public key file with ‘.pub’ extension.

Leave a Reply

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

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