Skip to main content

SSH Key Generation 🔐

SSH key pairs are essential for anyone in IT, especially when working with servers or pushing code to SCM systems like GitLab and GitHub. Consider your SSH key as a secure ID card—protect it well. Follow these steps to generate your SSH key.

Generating an SSH Key 🛠️

To create your SSH key pair, run the following commands:
cd ~/.ssh
ssh-keygen -t rsa -b 4096
cat id_rsa.pub

Important Notes:

  • During generation, you may be prompted to set a passphrase. While optional, adding a passphrase increases security, so consider using one you can remember.
  • Never share your private key (id_rsa file) with anyone.
  • The .pub file (e.g., id_rsa.pub) is your public key and can be shared for authentication. The other file (e.g., id_rsa) is your private key and must remain secure.

Loading SSH Keys 🗝️

To verify if your SSH key is loaded, use the following command:
ssh-add -l
If no keys are listed, load your SSH key manually:
ssh-add ~/.ssh/id_rsa
You’ll be prompted to enter your passphrase if you set one. Running ssh-add -l again should then show your loaded SSH key.
Following these steps ensures secure access to servers and SCM systems, safeguarding Wavez’s code and infrastructure. If you encounter any issues or have questions about SSH key management, feel free to reach out.