How to set up an SSH config-file for beginners [closed]

Generally, in Windows machine, the SSH config file stored in the following location: /c/Users/PC_USER_NAME/.ssh/

Just follow the steps in below (if you’re using the Git Bash):

  1. Go to the .ssh directory /c/Users/PC_USER_NAME/.ssh/, click right mouse button and choose “Git Bash Here”
  2. Create a file named “config” with the following command:
touch config
  1. Now open the config file with the command:
nano config
  1. Now write the following lines inside the config file

Let’s assume you’ve created two files named id_rsa_hub for Github and id_rsa_lab for GitLab

# GITHUB
Host github.com
   HostName github.com
   PreferredAuthentications publickey
   IdentityFile ~/.ssh/id_rsa_hub

# GITLAB
Host gitlab.com
   HostName gitlab.com
   PreferredAuthentications publickey
   IdentityFile ~/.ssh/id_rsa_lab

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)