On a standard Linux install with OpenSSH, what is the default rate limit for SSH login attempts using password authentication?
How many passwords can an attacker guess per hour?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
On every connection, there is specific limit of password prompts. It is defined by the
MaxAuthTries option (default is 6). But you can't do all the attempts at once. After each failed one, you will get some time penalty (~3 seconds to run through the PAM stack with delay).
The attacker can issue the connections in the rate limited by the
MaxStartups (default is 10:30:100, which will start rejecting connection if there is 10 unauthenticated connections open).
LoginGraceTime option is unrelated for the attacker, because it defines only the maximum time before the connection is closed by the server, if the attacker does not succeed to authenticate.
The limiting factor here is mainly key exchange, which takes time because:
My fast test showed that establishing connection to the Raspberry Pi in the other room takes roughly 1 second. But it could go faster and SSHD can handle more parallel requests. The password prompt from localhost is almost immediate.
Let's say attacker can simply issue 10 connections in parallel, waits 1 second for prompt, writes one password, waits 3 seconds for the second prompt (or confirmation that the password was actually correct) (... repeats 6 times until it bails out). This takes 1 + 3 * 6 seconds (19 seconds) for 6 password attempts in single thread, 60 password attempts in 10 threads. Rounding up to the 180 in a minute and 10k in an hour in this optimistic case.
Note that the attacker can increase the amount of threads to 20 or more with quite low probability of rejection, but getting to the twice as much attempts (or even more, but can't go over 100). This is why the
MaxStartups Specifies the maximum number of concurrent unauthenticated con‐ nections to the SSH daemon. Additional connections will be dropped until authentication succeeds or the LoginGraceTime expires for a connection. The default is 10:30:100. Alternatively, random early drop can be enabled by specifying the three colon separated values “start:rate:full” (e.g. "10:30:60"). sshd(8) will refuse connection attempts with a probability of “rate/100” (30%) if there are currently “start” (10) unauthenti‐ cated connections. The probability increases linearly and all connection attempts are refused if the number of unauthenticated connections reaches “full” (60).