I am trying to set up ssh config so that if I am sshing using a particular user then use a different key.
By default I want to ssh using my username (abcd) and my identity (~/.ssh/id_rsa)
eg) "ssh example.com" uses user abcd and ~/.ssh/id_rsa ... all good :D
But if I ssh using ssh defg@example.com i want to use the identity file ~/.ssh/id_defg_rsa
eg) "ssh defg@example.com" should use user defg and ~/.ssh/id_defg_rsa
I tried:
User defg
IdentityFile ~/.ssh/id_defg_rsa
I know I can use an alias but I was wondering if I could just set it up in ssh_config. I know you can condition on the Host, but i am wondering if I can also condition on a user.