Generate SSH key(s)
SSH keys comes in handy when working with for example GitHub.
Generate the keys with the following command,
ssh-keygen -o -t rsa -b 4096 -C "your-email@adress"
The keys are stored in .ssh folder inside your home folder.
/home/<username>/.ssh
When you run the ssh-keygen command. There are now two new keys in the .ssh folder. The keys are:
- id_rsa
- id_rsa.pub
The first key is private and the second key is public.
You should never share your private key to anyone.
You can have multiple keys on your computer
Let’s say that you want to use the Google Cloud Platform (GCP) services.
Google use the EdDSA signature.
Run the following command to create a key (signature) that Google supports.
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -C "your-email@example.com"
View the public key with the following command,
cat ~/.ssh/id_ed25519.pub
Copy the content of the file to the GCP console (https://console.cloud.google.com/).