Generating an SSH key in Linux
It is possible to get an SSH key in Linux. All you would need do is, just run the ssh-keygen command within the command line. Once you run this command, it’ll ask you for a file into which the key should be saved and a passphrase i.e. password for a key. For an eg.:-
user@localhost: ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_rsa.
Your public key has been saved in id_rsa.pub.
The key fingerprint is:
16:8e:e8:f2:1d:c9:b9:cf:43:9a:b3:3c:c1:1f:95:93 user@localhost
A private key will be created at /home/user/.ssh/id_rsa and a public key at /home/user/.ssh/id_rsa.pub. The passphrase is for the security of your key. If you try connecting via SSH, it will ask you to enter passphrase.