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?