6.9 Disable root login for SSH

Information

The PermitRootLogin value (in /etc/ssh/sshd_config) allows for direct root login by a remote user/application to resources on the local host.

Rationale:

By default, it is not possible for the root account to log directly into the system console because the account is configured as a role. This setting therefore does not significantly alter the security posture of the system unless the root account is changed from this default and configured to be a normal user.

Solution

Perform the following to implement the recommended state:

# awk '/^PermitRootLogin/ { $2 = 'no' } { 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: ACCESS CONTROL

References: 800-53|AC-2(3), CSCv7|16.8

Plugin: Unix

Control ID: 9fd049526b84d91caedc45c254184f6527f2b81cbd5b3d3a4d31ec08bb359b3f