6.5 Restrict Access to the su Command - wheel:x:10:root, <user list>'

Information

The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in the wheel group to execute su.

Rationale:

Restricting the use of su, and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo, whereas su can only record that a user executed the su program.

Solution

Set the pam_wheel.so parameters as follows in /etc/pam.d/su:

auth required pam_wheel.so use_uid

Set the proper list of users to be included in the wheel group in /etc/groups.

Default Value:

OS Default: No

See Also

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

Item Details

Category: ACCESS CONTROL

References: 800-53|AC-2, CSCv7|4

Plugin: Unix

Control ID: 7d7a4496ce573b3912ed304990c3d0c6e823c2af76bff4c390df44e32d913305