{"thread":{"id":"17547","subject":"GIT over ssh with identity file","startedAt":"2009-02-04T08:37:18Z","lastAt":"2009-02-04T09:25:06Z","messageCount":4,"participants":["oliverw","Junio C Hamano","Matthieu Moy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"103082","messageId":"21826348.post@talk.nabble.com","threadId":"17547","inReplyTo":null,"subject":"GIT over ssh with identity file","fromName":"oliverw","fromEmail":"oliver@weichhold.com","sentAt":"2009-02-04T08:37:18Z","receivedAt":"2009-02-04T08:37:18Z","isPatch":false,"sender":{"key":"oliver@weichhold.com","avatar":null},"body":"\nForgive me if this has been answered before. I've searched everywhere but\ncouldn't find a solution.\n\nIs it somehow possible to pass your private key file to git when working\nover ssh. What I have in mind would be something like this:\n\ngit -i /path/to/private/key clone ssh://homer@foo.bar.com/var/git/repos.git \n\nSince I want to use this on a server I would like to avoid using a password\ncaching agent at all cost.\n\n-- \nView this message in context: http://www.nabble.com/GIT-over-ssh-with-identity-file-tp21826348p21826348.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"103083","messageId":"7vbpti1tnd.fsf@gitster.siamese.dyndns.org","threadId":"17547","inReplyTo":"21826348.post@talk.nabble.com","subject":"Re: GIT over ssh with identity file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-04T08:41:10Z","receivedAt":"2009-02-04T08:41:10Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"oliverw <oliver@weichhold.com> writes:\n\n> Forgive me if this has been answered before. I've searched everywhere but\n> couldn't find a solution.\n>\n> Is it somehow possible to pass your private key file to git when working\n> over ssh. What I have in mind would be something like this:\n>\n> git -i /path/to/private/key clone ssh://homer@foo.bar.com/var/git/repos.git \n\nI think the standard way people use for things like this is something\nalong the lines of...\n\n    $ cat >>$HOME/.ssh/config <<\\EOF\n    Host homer-at-foo\n      Hostname foo.bar.com\n      User homer\n      IdentityFile ~/.ssh/homer-at-foo.pub\n    EOF\n    $ git clone homer-at-foo:/var/git/repos.git\n"},{"id":"103089","messageId":"vpqhc3aa8m0.fsf@bauges.imag.fr","threadId":"17547","inReplyTo":"7vbpti1tnd.fsf@gitster.siamese.dyndns.org","subject":"Re: GIT over ssh with identity file","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2009-02-04T08:50:47Z","receivedAt":"2009-02-04T08:50:47Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>     $ cat >>$HOME/.ssh/config <<\\EOF\n>     Host homer-at-foo\n>       Hostname foo.bar.com\n>       User homer\n>       IdentityFile ~/.ssh/homer-at-foo.pub\n\n(I think you have an extra .pub here, the identity file should be the\nprivate key).\n\n-- \nMatthieu\n"},{"id":"103095","messageId":"7veiyezh8t.fsf@gitster.siamese.dyndns.org","threadId":"17547","inReplyTo":"vpqhc3aa8m0.fsf@bauges.imag.fr","subject":"Re: GIT over ssh with identity file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-04T09:25:06Z","receivedAt":"2009-02-04T09:25:06Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>>     $ cat >>$HOME/.ssh/config <<\\EOF\n>>     Host homer-at-foo\n>>       Hostname foo.bar.com\n>>       User homer\n>>       IdentityFile ~/.ssh/homer-at-foo.pub\n>\n> (I think you have an extra .pub here, the identity file should be the\n> private key).\n\nYeah, you are right.  I am too tired and should have gone to bed 90\nminutes ago.\n"}]}