An SSH server that knows who you are
twitter.com
twitter.com
The top-rated comment mentioning having an "IdentitiesOnly yes" setting in your ~/.ssh/config is still relevant if you want to have multiple SSH keys and ensure that only specific hosts get specific keys.
EDIT: Also link is to a retweet, the source tweet is https://twitter.com/FiloSottile/status/1229093553269362689
https://gist.github.com/femto113/ef9162d670def84b3c684d2d305...
server -> user: nonce
user -> server: nonce2, h(nonce || nonce2 || publickey) (for every publickey)
or alternatively user -> server: nonce
server -> user: nonce2, h(nonce || nonce2 || publickey) (for every publickey)
It would still leak the amount of keys (for the user for the 1st protocol and for the server for the second) but nothing about them. (I would also suggest using a modern hash function for h, such as blake(2) or sha3)There should be a way to extend this protocol as to not leak the amount of keys.
Source: https://heipei.io/2015/02/26/SSH-Agent-Forwarding-considered...
Correct
> which is why I said that if someone who is able to redirect your SSH connection to a different server
I will try to be more clear. Often when I am away I use ssh to connect to my desktop pc which has a dynamic IP address. Even though I have already stored the public key of my server in known_hosts it keeps asking me to verify if I trust its public key every time that it changes IP address without even mentioning that it has met said public key before. So if I am not careful enough I might end up accepting the public key regardless, even if I am being MITMed.
>openssh makes the situation worse because +even+ if the key is already in your host file and it's just the ip/domain that changed it will not tell you that it recognises the key.
Sorry for the confusion, I misread your initial comment, thought you were saying it does what we're saying would be a good behaviour, and was confused as to why you thought this was a problem, but it was just I who was confused!
It is not, it just makes you identifiable. Public SSH keys are… well, public.
> Does it use a popular accounts index, or maybe he crawled a bit?
Ben Cartwright-Cox (aka. benjojo) [1] crawled many “github.com/USERNAME.keys” some time ago [2].
Filippo, being colleagues, probably asked for a copy of his database to run this experiment.
For example, here are the public SSH keys Linus Torvalds uses on GitHub [3].
[1] https://github.com/benjojo
[2] https://blog.benjojo.co.uk/post/auditing-github-users-keys
For example a server can send a challenge which requires knowledge of the private key to solve but does not reveal anything from the client on failure.
If the server has multiple authorized_keys it could just send multiple challenges and accept a reply for any of them.
Am I missing something? This seems like a nice privacy feature.
And it’s not so much “places you’re not supposed to” as “places you know haven’t been compromised in any way”, which is difficult to know unless you’re the sysadmin.
Most people don't care about this and so I'm comfortable with the default not being IdentitiesOnly
It's probably more surprising for any early adopters of FIDO for SSH, since WebAuthn (to do FIDO on the web) and its predecessor U2F both do ensure your identity can't be correlated between sites, but the new SSH support does not provide that.
Anyway, yes, I'm also comfortable with the default, I'm just pointing out why "don't SSH places you're not supposed to" isn't a relevant argument.
When you enroll your authenticator creates random credentials (made easier by using Elliptic Curve crypto so almost any random bits are a valid key unlike RSA) and then (unless you're using a much more expensive/ sophisticated device or a FIDO2 device in its resident credentials mode) it encrypts its own private key and delivers that as the cookie value. The remote server actually has your private key... but encrypted with a symmetric key that only exists inside your FIDO authenticator so it's actually safe.
OpenBSD's approach to using FIDO for SSH keeps this cookie element locally, not on the remote server. So the actual keys used will be constant across multiple servers and thus could be correlated to track you.
The other effect is that (again because that cookie is on your local client not the remote server like for WebAuthn) you can't use a cheap (non-resident enabled) FIDO authenticator from anywhere except the machine you used to enroll it. The authenticator plus a random (new enough) SSH client don't have enough information between them to get you in, they also need that cookie which is on, say, the laptop you left in a hotel room.
If that use case is essential for you, you can apparently use resident credentials. I haven't tried it, but a newer Yubico Security Key (with the numeral 2 printed on it to signify that it implements FIDO2) should be able to store everything, authenticated with a PIN, so then you can use a new enough SSH client plus that Security Key plus your PIN to log in from anywhere.
Alternatively if you have a cheaper FIDO device or choose not to use the resident mode of a newer one, this does have the effect that you can create different cookies from different laptops and then you can approve the resulting different keys for different purposes if that suits you. It could make sense to approve your company laptop's keys for checkin to corporate Git repos while the personal laptop has your GitHub keys while keeping just one FIDO key on your keychain throughout the day...
Edited to add: Residential credentials for SSH is apparently planned for OpenSSH 8.3, not OpenSSH 8.2 and so not available yet.
Will regular HTTPS certificates work?
* It's a lot easier to provision users because the per-server configuration is static.
* You can issue short-lived keys for users so that a lost laptop won't be carrying lots of dangerous SSH keys.
* You can force users through your standard authentication flow and get things like MFA without requiring the SSH servers to understand MFA individually.
Outside of this use case, it's not common to sign SSH keys at all. SSHFP isn't widely used; in fact, almost nobody uses it (because almost nobody uses DNSSEC in the first place). But even if you were set up to use it, SSHFP wouldn't do the things we're talking about when we talk about SSH CAs. In fact, it'd be hard to come up with a worse place to put user keys than in the DNS, which is public, even (in fact: especially) with DNSSEC.