Generating RSA key using Linux or Ubuntu

For linux or ubuntu user who is lazy to login to remote by typing password or plainly to improve security measure. You may generate a RSA key type to authenticate the login process. Generating the RSA key is the very first step.

Steps :

1. Open your command prompt.
2. Type the following :
sudo ssh-keygen -t rsa
*Note : If you are using CentOS or Redhat you may just use ssh-keygen -t rsa
3. The the following prompt will appear after you have key in the administrator/root password:
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
4. Just type myremotehost they press ¨Enter¨. Then the following prompt will appear :
Enter passphrase (empty for no passphrase):
5. Type in any keyword or password that you need. After ¨Enter¨ is pressed the following prompt will appear :
Enter same passphrase again:
6. Type in the same keyword or password used in step 5. After that the ssh-keygen will generate the pair of key and will be placed on the location selected in step 3.
Your identification has been saved in myremotehost.
Your public key has been saved in
The key fingerprint is:
2c:16:7c:16:89:4d:ac:87:77:e5:22:90:50:2b:3d:d8 susr1@einsam-laptop
7. Type the following :
ls|grep myremote
8. If the key is generated you should get the following result :

8. Congrats, your RSA key pair is generated successfully.

The RSA key is ready to be use . How to apply the RSA key will be shown on the next post 🙂

Leave a Reply

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

To prove you're a person (not a spam script), type the answer to the math equation shown in the picture. Click on the picture to hear an audio file of the equation.
Click to hear an audio file of the anti-spam equation