Creating a SSH key pair

Linux

Open a terminal and type:


 user@host:~$ ssh-keygen

You'll be asked for a filename (leave default).

Due to security reasons is strongly advised to input a passphrase for created keys.


 Generating public/private rsa key pair.
 Enter file in which to save the key (/home/user/.ssh/id_rsa):
 Enter passphrase (empty for no passphrase):
 Enter same passphrase again:
 Your identification has been saved in /home/user/.ssh/id_rsa.
 Your public key has been saved in /home/user/.ssh/id_rsa.pub.
 The key fingerprint is:
 SHA256:hnifzffH0W7g9iROT8NSGfQK/ciW2KvyeXeMnIvVsW user@machine
 The key's randomart image is:
 +---[RSA 2048]----+
 |               . |
 |             .. .|
 |            . ...|
 |     . .     = =o|
 |    . o S   . BEo|
 |     . o +   .*++|
 |        o o .+=@=|
 |          .. OO=X|
 |           o=o+*+|
 +----[SHA256]-----+

Your ~/.ssh directory should contain at least two files:


 -rw-------  1 user group    1679 Aug  5  2015 id_rsa
 -rw-------  1 user group     405 Aug  5  2015 id_rsa.pub

Done!

Windows

Download PuTTY from here.

Run PuTTYgen.exe

PuTTYgen Step1

Before you click 'Generate' change number of bits in generated key to 4096.

PuTTYgen Step2

 Click 'Generate' and move your mouse to help your computer gather random bits until green bar fill up.

PuTTYgen Step3

Change 'Key comment' to a name of a computer you will use key on.
It helps to identify keys you use.

Due to security reasons is strongly advised to input a passphrase for created keys.

Save private key in secure location!

Done!