Asking git to look for different key other than id_rsa

I not sure why but even though I mention properly in ssh config to look for identity file with name viren.pub for github

git still considering id_rsa as default and it does not seem to work unless an until i rename viren.pub and viren to id_rsa.pub and id_rsa

  • How to view files in bare repositories?
  • How can I pull a remote repository with GitPython?
  • nuances between other version control and GIT
  • A way not to wait for Heroku to compile/Git pre-receive hook to finish
  • What causes Google gcloud error message “ERROR: (gcloud) Invalid choice: 'get'. Did you mean 'meta'?” mean?
  • A merge was done wrong. How can I fix it?
  • Here my ssh config look like

    Host ec2-123-121-121-121.compute-1.amazonaws.com
            Hostname github.com
            User git
            IdentityFile /root/.ssh/viren
    

    Can anyone help

  • Is it Possible install git in xampp localhost?
  • Merging two git repositories as different versions
  • How can I deploy a node.js app to azure via git when the app is in a subfolder?
  • JGit: How to squash commits
  • Problem with Hudson + Git + Gitosis on windows
  • what's the advantage of integrating GIT LFS with artifactory
  • One Solution collect form web for “Asking git to look for different key other than id_rsa”

    I believe the ssh config only applies if you use the alias defined in host clause to connect to the server.

    I.e. you should have in ssh config have:

    host github
        hostname github.com
        user git
        identityfile /root/.ssh/viren
    

    The host directive has to be followed with something you will actually use to connect, so [Amazon server] is not appropriate. And you have to tell git to connect to:

    github:/....
    

    (and not git@github.com:/.....)

    Git Baby is a git and github fan, let's start git clone.