How to Generate SSH Key in Linux?

To generate SSH 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:
16:8e:e8:f2:1d:c9:b9:cf:43:9a:b3:3c:c1:1f:95:93 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 Users Found This Useful
Was this answer helpful?

Related Articles

How to log in to my Hostlantern shared account via SSH in Linux?

First you should generate an SSH key pair on your Linux distribution. Alternatively, you can...

How to log in to my Hostlantern shared account via SSH using PuTTY?

Please note that due to our security policy, we don't use the default SSH port. Please use port...

How to log in to my Cloud hosting/VDS via SSH using PuTTY?

The following instructions are valid only for Hostlantern customers. If you are not a Hostlantern...

How to Enable SSH for Cloud VPS on Windows

You can establish an SSH connection using the PuTTY SSH client. You can download PuTTY for free...

How to Enable SSH for Cloud VPS on Linux

First you need to generate SSH key pair for your connection. Under Linux you can do so using the...