Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asking git to look for different key other than id_rsa

Tags:

git

github

ssh

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

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

like image 377
Viren Avatar asked May 22 '12 08:05

Viren


1 Answers

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 [email protected]:/.....)

like image 147
Jan Hudec Avatar answered Sep 28 '22 02:09

Jan Hudec