How to generate SSH keypairs

We will be using Redhat / CentOS conventions in our examples in terms of the file paths.

Generate the Key Pair

ssh-keygen -t rsa -b 2048

This should generate the files in ~/.ssh/, “id_rsa” and “”

id_rsa is your private key and should NEVER be given out. is your public key which can be freely shared.

Enjoy better security!