RE: How to use multiple SSH keys on Git exe (not bash)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On January 10, 2018 10:31 AM Sam Millman wrote:
> I am trying, for the sake of PhpStorm, to get multiple SSH keys working using
> git . exe, which means no GitBash.
> 
> I can get the keys to work just fine with GitBash.
> 
> I edited my .ssh/config to look like (I know this is incorrect):
> 
> Host bitucket . org
> IdentityFile ~/.ssh/id_rsa1
> 
> Host bitbucket . org
> IdentityFile ~/.ssh/id_rsa
> 
> 
> And id_rsa1 works, I can actually pick from the other repo. But, of course,
> id_rsa does not now.
> 
> I change to:
> 
> Host bitucket . org-dd
> HostName bitbucket . org
> IdentityFile ~/.ssh/id_rsa1
> 
> Host bitbucket . org-sas
> HostName bitbucket . org
> IdentityFile ~/.ssh/id_rsa
> 
> And now only id_rsa works.
> 
> I also tried combining the two IdentityFile lines together like so (for some
> reason):
> 
> Host bitucket . org
> IdentityFile ~/.ssh/id_rsa1
> IdentityFile ~/.ssh/id_rsa
> 
> I have even tried running ssh-agent . exe, adding id_rsa1 to that and then
> running the git clone with no result.
> 
> The weird thing is, I have two public keys as well and they both load in the
> ssh . exe (they return errors about format), I just cannot get my ssh . exe to
> work with multiple private keys.
> 
> On 10 January 2018 at 15:29, Sam Millman <sam.millman@xxxxxxxxx> wrote:
> > I am trying, for the sake of PhpStorm, to get multiple SSH keys
> > working using git . exe, which means no GitBash.
> >
> > I can get the keys to work just fine with GitBash.
> >
> > I edited my .ssh/config to look like (I know this is incorrect):
> >
> > Host bitucket . org
> > IdentityFile ~/.ssh/id_rsa1
> >
> > Host bitbucket . org
> > IdentityFile ~/.ssh/id_rsa
> >
> >
> > And id_rsa1 works, I can actually pick from the other repo. But, of
> > course, id_rsa does not now.
> >
> > I change to:
> >
> > Host bitucket . org-dd
> > HostName bitbucket . org
> > IdentityFile ~/.ssh/id_rsa1
> >
> > Host bitbucket . org-sas
> > HostName bitbucket . org
> > IdentityFile ~/.ssh/id_rsa
> >
> > And now only id_rsa works.
> >
> > I also tried combining the two IdentityFile lines together like so
> > (for some
> > reason):
> >
> > Host bitucket . org
> > IdentityFile ~/.ssh/id_rsa1
> > IdentityFile ~/.ssh/id_rsa
> >
> > I have even tried running ssh-agent . exe, adding id_rsa1 to that and
> > then running the git clone with no result.
> >
> > The weird thing is, I have two public keys as well and they both load
> > in the ssh . exe (they return errors about format), I just cannot get
> > my ssh . exe to work with multiple private keys.
> >
> > Has anyone got any ideas on how to solve this?

The ~/.ssh/config file is case sensitive by definition when it comes to Host and HostName. Try bitbucket.org for one and Bitbucket.org for another. You will have to change the remote URL accordingly to pick up the correct identity.

Good luck,
Randall





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux