How to add quickly and easily multiple SSH keys to Desktop (Ubuntu, Window, …)
The first time I use the DevOps platform is GitLab. I don’t know what SSH is and why we need to know and use SSH for our machine.
What is SSH?
The Secure Shell Protocol (SSH) is a cryptographic network protocol for operating network services securely over an unsecured network. Typical applications include remote command-line, login, and remote command execution, but any network service can be secured with SSH.
An easy way to know that SSH is used to confirm with your host and your machine is that It’s your identity. It’s secure and the most popular method the developer often uses. In detail, go to https://en.wikipedia.org/wiki/Secure_Shell_Protocol. My purpose for this article that how to add multiple SSH keys to your desktop.
You need to open your command line and address to your root.
If you have ever not used SSH:
ssh-keygen -C "email@example.com"
It will generate:
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa):
Because the first time you use SSH, then you click enter for all questions.
You address to your root in the terminal:
ls // id_rsa.pub known_hosts id_rsa
All content from id_rsa.pub file is shown. You copy that and go to GitHub, GitLab,… and add to SSH Integration in the profile setting.
Others: go to .ssh folder from your root folder and read file id_rsa.pub
If you have used SSH:
Do all steps above except for below case. You should rename to another address. If you click enter all. It’s duplicated and your old platform will be deleted. In this case, I rename into id_rsa_github for my new SSH key github.
Enter file in which to save the key (/home/user/.ssh/id_rsa): /home/user/.ssh/id_rsa_github
Ok, you created successfully and go to your .ssh folder and read id_rsa_github.pub file to copy and integrate into your platform you want!