Generating a new SSH key on Linux / Mac
-
Open Terminal.
-
Paste the text below, substituting in your email address.
$ ssh-keygen -t rsa -b 4096 -C "[email protected]"
This creates a new ssh key, using the provided email as a label.
> Generating public/private rsa key pair.
-
When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.
> Enter a file in which to save the key (/home/you/.ssh/id_rsa): [Press enter]
-
At the prompt, type a secure passphrase. Leaving it blank is fine
> Enter passphrase (empty for no passphrase): [Type a passphrase] > Enter same passphrase again: [Type passphrase again]
Generating a new SSH key on Windows
- Download and install the PuTTY SSH Client for Windows.
- Navigate to Start menu -> All Programs -> PuTTY -> PuTTYgen.
- Click Generate to generate the key and follow the instructions
- Copy the returned public key.