2

I have a number of entries in ~/.ssh/config:

Host github.com
  Hostname github.com
  User git
  IdentityFile ~/.ssh/github

Host mydomain.com
  User name
  IdentityFile ~/.ssh/id_rsa

Host [email protected]
  Hostname work.com
  User full.name
  IdentityFile ~/.ssh/work_rsa

If none match, the default fallback is id_rsa. But I'd like a different fallback. The following attempt failed, because it catches everything, overriding any previous settings.

Host '*'
  IdentityFile ~/.ssh/fallback

What is the correct way to express "none of the above"?

lofidevops
  • 2,967
  • 6
  • 39
  • 58
  • 1
    based on https://unix.stackexchange.com/questions/16571 I was thinking of defining Host '*' at the top – lofidevops Apr 12 '18 at 15:01
  • 1
    What happens if you just put `IdentityFile ~/.ssh/fallback` outside of a `Host` block? – habs Apr 12 '18 at 15:56

0 Answers0