GitHub Setting up SSH Key

Generating the SSH keys

Abdul Baasith
2 min readJul 3, 2021

is known as secure shell its just public and private key pairs

definition

ssh-keygen is a standard component of the Secure Shell protocol suite found on Unix, Unix-like and Microsoft Windows computer systems used to establish secure shell sessions between remote computers over insecure networks

No more talks lets learn how to set up SSH Key

Step 1

Check whether there are any existing SSH keys available to reuse.

You can use ls -al~/.ssh command to check it. (Use it in git bash)

If there are no keys, you can use ssh-keygen -t rsa -C “your_git_account_email” to generate new SSH keys for each git account.

After generating it will be asked the location to save the key file. Press enter to leave the default location

Now lets copy the key what we use is the id_rsa.pub so we need to get the key and copy it use cat id_rsa.pub” keep the key copied for the next step😜

Step 2

Add SSH key to GitHub account

  1. Login to all git accounts.
  2. Go to settings.
  3. Click “SSH and CPG keys”.
  4. Click on “New SSH key”.
  5. Enter the preferred title and paste the key.
  6. Click “Add SSH key”.
  7. Repeat steps to for your all git accounts.

Now set up the config file

#  account 1
Host github..com
HostName github..com
IndeittyFile~/.ssh/saved_ssh_key_filename
# account 2
Host gitlab.com
HostName gitlab.com
IndeittyFile~/.ssh/saved_ssh_key_filename

Done and dusted🙌

images for more understanding

--

--

Abdul Baasith
Abdul Baasith

Written by Abdul Baasith

Hi there i'm Abdul Baasith, A passionate Software Engineer . If your tool is a hammer then every problem look like a nail

No responses yet