What is the risk of committing the IdentityFile line for each of my Host entries in my ~/.ssh/config to my public dotfiles repository? Would providing such information make it any easier for an attacker to compromise those keys?

cat ~/.ssh/config
Host SE
  Hostname security.stackexchange.com
  User rage
  IdentityFile ~/.ssh/security_key


IdentityFile ~/.ssh/id_rsa

Note: this is the default key name when invoking ssh-keygen.

  • If you committed all your private keys, then yes, that's a huge huge problem. If you only committed your ssh config, then no, they cannot do much with the information except see where you connect and know your username for each system. It might help with social engineering later. – Pheric Mar 1 '20 at 21:35
  • No, not the actual keys themselves; just the names. – oxr463 Mar 2 '20 at 0:19
  • 1
    Then I'd say you're probably fine. If you want you can change your usernames but that's probably it; relying on the name and locations of your private keys is security through obscurity and shouldn't be trusted anyway. – Pheric Mar 2 '20 at 0:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.