Creating an SSH key

We will use a program called ssh-keygen to generate our SSH key. Run the following command:

$ ssh-keygen -t rsa -b 4096 -C <your-email-address>

Here, we are passing a few parameters to ssh-keygen, which instructs it to use the Rivest-Shamir-Adleman (RSA) cryptographic algorithm to generate key pairs of 4,096 bits in length. By default, ssh-keygen uses a key length of 2,048 bits, which should be sufficient, but since 4,096 is significantly harder to brute-force, why not enjoy that bit of extra security?

There are many algorithms that can be used to generate key pairs. ssh-keygen accepts DSA, RSAEd25519, and ECDSA. DSA is an old algorithm that is superseded by RSA, and should not be used. Ed25519 and Elliptic Curve Digital ...

Get Building Enterprise JavaScript Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.