ssh -o IdentitiesOnly=yes -i /dev/null host
Specifying just IdentitiesOnly is not enough.In what manner?
> Specifies that ssh(1) should only use the authentication identity and certificate files explicitly configured in the ssh_config files or passed on the ssh(1) command-line, even if ssh-agent(1) or a PKCS11Provider offers more identities.
Configuring your ssh correctly would avoid a specific system to link you to another one. More privacy issue than security.
I was curious about this, so I did some research.
First, if you run `ssh -v`, you can see that there's a key exchange (eg, Diffie-Hellman), then a cipher and MAC are negotiated, and only once you get to the user authentication portion do your public keys get sent to the server.
So, only Alice and Bob can see the public keys: not Mallory.
Further reading: SSH transport layer, https://tools.ietf.org/html/rfc4253
If I recall correctly, if you specify it for a single host, it tries all your default keys then tries the specified key if nothing else worked. Which seems weird and wrong to me, but what do I know. Anyway, thanks for (possibly) solving a mystery for me.
Configuration options may be separated by whitespace or
optional whitespace and exactly one `='; the latter format
is useful to avoid the need to quote whitespace when
specifying configuration options using the ssh, scp, and
sftp -o option.
If you want to disable this sort of behaviour you can disable SSH from sending keys automatically, and then tell SSH which identity files need to be sent to each host.
In your .ssh/config, something like:
https://news.ycombinator.com/item?id=10004678