Create a file called ~/.ssh/config
SSH will look for the user’s ~/.ssh/config file. I have mine setup as:

Host            gitserv
    Hostname        remote.server.com
    IdentityFile    ~/.ssh/id_rsa.github
    IdentitiesOnly yes # see NOTES below

Above can be used for both cloning/pushing git repository and logging in to the server.

gitserv : hostname which is  “git@github.com” in below example

git clone    git@github.com:orgname/repname.git

 pvt file to have access  rights of 600

How t to manage multiple ssh-keys and connect them to servers

Leave a Reply

Your email address will not be published.