Generating SSH keys

Written by Robert -

Here we are going to generate 4096 bit keys to use with SSH.

To generate SSH keys on your desktop, use the following command:

I assume that you have ssh-keygen installed. If that's not the case, consult the manual of your distribution.

ssh-keygen -t rsa -b 4096

1

This is the location for your private key. The default should work for most users.

2

Enter a difficult password, something that you don't use for anything else.

4

Repeat the password.

5

Here you can see that it successfully created both the public (~/.ssh/id_rsa.pub) and the private (~/.ssh/id_rsa) keys. The randomart is not something you usually need.

Always keep your private key private.

Comments