macOS Sierra 10.12.4, OpenSSH_7.4p1, LibreSSL 2.5.0.
My ssh config file is setup as follows (just one of the servers):
Host github
Hostname github.com
HostKeyAlias github
User git
IdentityFile /Users/abhay/.ssh/github
IdentitiesOnly yes
When I use ssh github at the command line, it works without problem, the correct identity file is used and I'm able to log in.
But if I use ssh [email protected], the config is ignored, and my default identity file id_rsa is used instead. This is true for other servers too, not just github.
Is this how it is supposed to work? Sometimes I forget the alias or just prefer to login with complete user@server but then ssh fails.
How to resolve this?