0

This is my ssh-config -

Host github.com
   HostName github.com
   User git
   IdentityFile ~/.ssh/id_rsa_gortnm // vansham-gortnm
   IdentityFile ~/.ssh/id_rsa_github // vanshamagg

And I am using the command ssh -N github.com to check which account connects to.

I get the response something like -

Hi vanshamagg! You've successfully authenticated, but GitHub does not provide shell access. Connection to github.com closed.

When I specify only one Identity it connects to the right account. But whenever I add both Identities, it always connects to vanshamagg no matter in what order I specify the keys.

Any ideas why it might be happening?

Vlad L.
  • 154
  • 1
  • 9
  • https://stackoverflow.com/search?q=%5Bgithub%5D+%5Bssh%5D+multiple+accounts – phd Aug 19 '21 at 16:30
  • As for your question exactly: `ssh` always uses the first key found in `.ssh/config`. So put specific options at the beginning and more generic options at the end of the file. – phd Aug 19 '21 at 16:31

0 Answers0