Generate SSH key pair

created by , 22. 02. 2014

This tutorial will show you how easy is to create ssh key pair.

Inputs / Conditions / Prerequisites
  • 1

    login to linux machine

  • 2

    make an empty directory your current directory

  • 3

    run following command:

    ssh-keygen -t rsa -b 2048 -f id_rsa

    Optional: you may add parameter -C comment to change default comment. Default comment is yourLogin@yourServer)

  • 4

    When prompted for passphrase, you may decide to enter it or leave it empty. For better security, enter this passphrase. Everytime you will want to use your private key, you have to enter this password.

  • 5

    Two files are created:

    • id_rsa
      • contains your private key. Make sure you are the only one who has access to this file.
      • contains your public key. You may freely distribute this key to everyone who needs it (e.g. copy to another servers for ssh public/private key login, to your colleagues or friends to send you encrypted messages, etc.)

Let your friends know about this site...