Setting up SSL for multiple git accounts

Hakeem Fazli
2 min readJul 5, 2021

What is SSL?

SSL is a secure protocol developed for sending information securely over the Internet. Many websites use SSL for secure areas of their sites, such as user account pages and online checkout. Usually, when you are asked to “log in” on a website, the resulting page is secured by SSL.

Step 1 — Checking for existing SSH keys

  1. First open Git Bash app.
  2. Then enter ls -al ~/.ssh to see if existing SSH keys are available.
  3. Checking the directory listing to see if you already have a public SSH key.
  4. The default filenames of public keys are one of the following:

id_dsa.pub
id_ecdsa.pub
id_ed25519.pub
id_rsa.pub

Checking for existing ssh keys

Step 2— Creating new SSH keys

  1. First open Git Bash terminal.
  2. Then enter: $ ssh-keygen -t ed25519 -C “<Your email address>”
  3. Then a new SSH key will be created and you will be asked to enter a file to save the key. Simply press Enter key and accept the default location. Later you will be asked to enter passphrase. For detailed information follow this guide in GitHub Docs.

Step 3— Add SSH key to the GitHub account

  1. First go to the GitHub account.
  2. Then go to settings and then look for SSH & GPG keys.
  3. Click on New SSH.
  4. Then add in a new SSH key with any title and the copied.
Adding new ssh keys

Step 4— Creating a SSH config file.

Type in the following commands.

cd ~/.ssh
touch config
subl -a config

Then in the config file all the other accounts could be saved as follows.

#  account 1
Host github..com
HostName github..com
User gitIndeittyFile~/.ssh/saved_ssh_key_filename

# account 2
Host gitlab.com
HostName gitlab.com
User git
IndeittyFile~/.ssh/saved_ssh_key_filename

Thank you very much for coming towards the end of the article, hope you learnt something useful.

--

--