3 ms·
Double-reading the man page I noticed that IdentitiesOnly makes ssh only send IdentityFile keys, however IdentityFile has a default of "~/.ssh/id_dsa, ~/.ssh/id
by FiloSottile 11y ago
Double-reading the man page I noticed that IdentitiesOnly makes ssh only send IdentityFile keys, however IdentityFile has a default of "~/.ssh/id_dsa, ~/.ssh/id_ecdsa, ~/.ssh/id_ed25519 and ~/.ssh/id_rsa".
The result is that with this configuration you would still send id_rsa to unknown hosts.
You also need to add "PubkeyAuthentication no" to your global stanza, and re-enable it for good hosts.
# Ignore ssh-agent keys
IdentitiesOnly yes
# Disable public key authentication
PubkeyAuthentication no
# Send your public key to github only
Host github.com
PubkeyAuthentication yes
IdentityFile ~/.ssh/id_rsa
More instructions: https://github.com/FiloSottile/whosthere#how-do-i-stop-it https://github.com/FiloSottile/whosthere#how-do-i-stop-it
- chrisfosterelli 11y agoAh, good catch! I don't normally name my keys after the default "id_rsa" so I didn't notice that. You will need that configuration you showed if you have keys that use the default value.
- toyg 11y agoDoesn't seem to work for me, the global option is not overridden. Bog standard osx OpenSSH_6.2p2. Ah well, I don't have any default key anyway.
- blfr 11y agoYou also need to add "PubkeyAuthentication no" to your global stanza, and re-enable it for good hosts. Or rename the id_* keys to something else. If you're using multiple key pairs will want more descriptive names anyway.