First, we are going to check whether you have any SSH keys present. Open your terminal and enter the following command:
$ ls ~/.ssh
If you have a file named
id_dsa.pub, you can skip this recipe.
To generate a new SSH key, you need to open your terminal and enter the following command:
$ ssh-keygen -t rsa -C "Comment for key"
The comment can be anything you want; it makes it easier for you to see which key it is when you open the key file.
Now, we get to the question of what you want to name your key. Just press Enter.
You will be asked to enter a passphrase. Enter it, and be sure to choose a strong password.
You should see the following screenshot:
Your SSH key is now generated.