6.12 Limit Consecutive Login Attempts for SSH

Information

The 'MaxAuthTries' parameter in the /etc/ssh/sshd_config file specifies the maximum number of authentication attempts permitted per connection. By restricting the number of failed authentication attempts before the server terminates the connection, malicious users are blocked from gaining access to the host by using repetitive brute-force login exploits.

Rationale:

By setting the authentication login limit to a low value this will disconnect the attacker and force a reconnect, which severely limits the speed of such brute force attacks.

Solution

Perform the following to implement the recommended state:

# awk '/MaxAuthTries/ { $1 = 'MaxAuthTries'; $2 = '6' } { print }' /etc/ssh/sshd_config > /etc/ssh/sshd_config.CIS

# mv /etc/ssh/sshd_config.CIS /etc/ssh/sshd_config

# svcadm restart svc:/network/ssh

See Also

https://workbench.cisecurity.org/benchmarks/4777

Item Details

Category: CONFIGURATION MANAGEMENT, SYSTEM AND SERVICES ACQUISITION

References: 800-53|CM-1, 800-53|CM-2, 800-53|CM-6, 800-53|CM-7, 800-53|CM-7(1), 800-53|CM-9, 800-53|SA-3, 800-53|SA-8, 800-53|SA-10, CSCv7|5.1

Plugin: Unix

Control ID: 23969d341abf8b276b7a0d327dc23b4f3b391686a2700094db0260a96d2c55a9