ChallengeResponseAuthentication no # \
PasswordAuthentication no # | nukes "Password: "
UsePAM no # /
PermitRootLogin no # (duh)
PubkeyAuthentication yes # enables public keys; very important
AllowUsers user1 user2 # maybe? combine with an obscure username...Incidentally I only ever used it at home, on a LAN that only has devices I know about on it. In a work environment I'd only ever do the same running off an isolated lab switch.
But in certain situations, "login to the box as root w/ no pw" is awesome for rapid bringup/diagnosis/repair/whatever.
a) Why are you using bleeding edge software in production, and especially so unreleased versions of OpenSSH?
b) Why are your SSH servers exposed to public traffic?
c) User enumeration is useful for finding accounts with weak passwords. Why do you have personal accounts on prod servers? Why do you have _any_ accounts not using public key authentication at all?
> We believe that this issue warrants a CVE; it affects all operating systems, all OpenSSH versions (we went back as far as OpenSSH 2.3.0, released in November 2000), and is easier to exploit than previous OpenSSH username enumerations...
As for b) and c), I 100% agree.
In fact: if you're using KVM-based virtualization, and you have VNC or serial access to your node (GCP gives you serial access, via web UI or an SSH-based proxy), you could completely _disable_ standard network-based login. (Writing an admin tool that connects to the serial console, gets a usable shell, and enables your sshd for when you need it, is an exercise for the inspired sysadmin. :P)
But this fun little trick is going to break a lot of stuff.
Perhaps a valuable resource would have a disposable proxy in front of it; then one way in (or even no ways in!) might be viable.
c) Not only production servers utilize internet.
c) fair enough, although you should probably be using keypairs and a vpn for test and dev envs too.
Other commenters have mentioned this attack getting information on hosted services on the system. But, usually you can get that from a straightforward nmap or other recon tool anyway.
In SSH first every connection is encrypted (before either side knows who the other is, encryption is used already, this is the same approach taken in TLS 1.3), then the server has to authenticate to the client, and then the client authenticates to the server on behalf of a specific user.
User public key authentication is a multi-phase protocol. This would be too awkward for something like HTTP where round trip times may be appalling, but SSH is rarely used at long distances.
In phase 1 the client proposes that it can authenticate for some public key Pn, it sends this proposal to the server, and the server can either say OK, go ahead, or reject this authentication without seeing it done, on the basis that it doesn't trust Pn anyway. It can keep trying different Pn until either it runs out or the server grows tired of this nonsense and disconnects it.
Once it has an OK, in phase 2 the client signs a nonce with the private key corresponding to Pn, which the server can now verify. If the signature checks out, the authentication was successful.
This means an adversary who knows your SSH username but has nothing else would need to literally _guess_ your hypothetical 1024-bit RSA key, not just (already hard but plausibly within the grasp of a resourceful adversary) break a 1024-bit RSA public key to find the associated private key, as your client only tells authenticated servers even the _public_ key.
Aside: One thing I'm surprised I haven't seen done with this part of the SSH design is user TOFU [Trust On First Use]. Lots of home or small / non-security business SSH setups do TOFU for server authentication, sometimes with a fig leaf ("Ask Jerry in IT to tell you the SSH keys" or "The SSH server keys are pasted into this Wiki page"). But I've never seen people do TOFU for the user authentication. In a similarly lax environment why not set up new users, and then when they first connnect just accept whichever public key they offer as "their" key, set that as trusted, and from then on insist on the same key for that user ? I feel like password auth is often left enabled because people are using it for an "initial" authentication step when first setting up without yet trusting any keys - and then never remove it. With "User TOFU" they'd have no incentive to enable password authentication at all.