I have read on a few guides on "how to secure SSH servers" that it is a good thing to increase
ServerKeyBits from the default of 768 to 2048.
Most of these guides seem to be for the entry level/novice server admin (which I am) to quickly protect themselves from scripted brute force root ssh login attempts and things like that, and I am trying to understand the point of each security measure.
I've been reading up on how public-key based authentication works, specifically for SSH v2. I have not seen anything about the SSH server's host key being used in the process of client authentication at all, by that I mean proving that the client is trusted.
It seems to only be used to ensure that the host a client is connecting to is the same one its connected to in the past - that it's not an impostor.
I am wondering, practically speaking, why it is such a big deal to increase the host key to 2048. Does it make it harder for an attacker to somehow brute force the private host key? Even if an attacker were able to figure out the private host key, so that a client/or the administrator would be able log into the fake host, how would that benefit the attacker?
Also included in these guides is setting
so the user shouldn't even be expecting to enter a password anyway. If they were so unaware of things to enter a password when they usually don't have to, wouldn't they just blindly accept a different host key anyway? Then if the attacker had the password, then what? Password authentication is disabled on the server anyway, so they still wouldn't be able to log in. From what I read, the attacker would not be able to gain any useful information from the client in the authentication process even if the client trusts the servers identity.
I feel like I am missing something major about how SSH public-key authentication works, because I don't understand why having a long host key seems so important. Does it make it harder for client credentials to be compromised somehow? What could actually happen if the private host key is compromised?