Skip to content

Generating an SSH Key in Linux

  • You might already have one, check whether a file ~/.ssh/ is present.
  • Otherwise, create key using the following command (marking your key with your email address will make it easier to reidentify your key later on):
    $ ssh-keygen -t ed25519 -C ""
  • Use the default location for your key
  • Enter a passphrase twice to encrypt your key

What is a key passphrase?

You should set a passphrase when generating your key pair. It is used for encrypting your private key in case it is stolen or lost. When using the key for login, you will have to enter the passphrase. Many desktop environments offer ways to automatically unlock your key on login.

Read SSH Basics for more information.

The whole session should look something like this:

host:~$ ssh-keygen -t ed25519 -C ""
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/USER/.ssh/id_ed25519): 
Created directory '/home/USER/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again: 
Your identification has been saved in /home/USER/.ssh/id_ed25519.
Your public key has been saved in /home/USER/.ssh/
The key fingerprint is:
The key's randomart image is:
+--[ED25519 256]--+
|.. . . o         |
|. . . + +        |
|.    . = . .     |
|.     . +oE.     |
|.       So= o o  |
| . .   . * = + + |
|  +   o + B o o .|
| oo+. .B + + .   |
|.ooooooo*.  .    |

The file content of ~/.ssh/ should look something like this):

ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFzuiaSVD2j5y6RlFxOfREB/Vbd+47ABlxF7du5160ZH

Submit Your Key

As a next step you need to submit the SSH key use these links as: