Reading time: 2 minutes
Today, I’m going to show you how to create an RSA key for use in your Github projects (https://github.com/)
The first thing we need to do is generate an RSA key in Ubuntu or WSL:
ssh-keygen -t rsa -b 4096 -C "email@example.com"
Replace “email@example.com” with the email associated with your Gitlab account.
It will prompt you for a file name and a passphrase (you can leave it empty if you don’t want a passphrase).
When asked for the key’s filename, enter:
.ssh/id_rsa
Add the Key to Github
- Copy the content of the public key (
cat ~/.ssh/id_rsa.pub
) to your clipboard. - Open Github and go to your profile > settings > SSH and GPGKeys.
- Click on “New SSH Key”.
- Give the key a name (e.g., “My Github SSH Key”).
- Paste the content of the public key into the “key” field.
- Click on “Add SSH key”.
Now you have successfully imported your Gitlab project to Github. You can now use Github’s features and collaborate with others on your project. Enjoy coding and exploring the possibilities!