6.1.9 Disable SSH root Login - Check if PermitRootLogin is set to no and not commented for the server.

Information

The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no.

Note - If you will be editing all the SSH parameters, use the script in section 6.1 Configure SSH.

Solution

Edit the /etc/ssh/sshd_config file to set the parameter as follows-
awk '/^PermitRootLogin/ { $2 = 'no' } { print }' /etc/ssh/sshd_config > /etc/ssh/sshd_config.new
/usr/bin/mv /etc/ssh/sshd_config.new /etc/ssh/sshd_config
/usr/sbin/pkgchk -f -n -p /etc/ssh/sshd_config
/usr/sbin/svcadm restart svc:/network/ssh

See Also

https://workbench.cisecurity.org/files/614

Item Details

Category: ACCESS CONTROL

References: 800-53|AC-17(4)

Plugin: Unix

Control ID: d79da987c3d37e416884a624d5932d8c6b6b8bfe745ec5c09715e63d14905218