Skip to content

How to generate ssh keys

Linux/Mac

  1. Open terminal and enter the command below to launch the process of generating SSH keys:
$ ssh-keygen -o -b 4096 -t rsa

2. While the keys are generated, you will be asked to enter path to where the keys should be stored (the default is /home/user/.ssh/id_rsa). 3. Then you will be asked to enter passphrase for you key (not mandatory, but recommended).
4. Finally you will be shown paths to id_rsa (contains private key) and id_rsa.pub (contains public key, which you will need to upload to your server to use it) files.

Windows

  1. Download PuTTY zde
  2. Start PuTTYgen
    Start menu -> All Programs -> PuTTY -> PuTTYgen
  3. Make sure option RSA is chosen in the lower part of window and they key length is 4096 instead of 2048. Then click Generate.
  4. While the keys are generated move, your mouse in random directions (this is used as a source of randomness for the generation process).
  5. When the generation finishes, you will be shown public key (which you will need to upload to your server) in a separate window.
  6. Then set Key comment to something, that will help you to identify the public key. For example mail of the owner. You can enter private key passphrase for enhanced security (not mandatory, but recommended).
  7. Lastly, click Save Public Key and Save Private Key to save the keys.