Restrict user su to root

eg: Specifies testuser user can switch to the root user

 

1.root operation, the user modifies the specified additional set wheel testuser

    # usermod -G wheel testuser

 

2. Remove the su file follows the line of the "#"

    # We /etc/pam.d/su

#auth            required        pam_wheel.so use_uid

 

3. File login.defs last line add "SU_WHEEL_ONLY yes"

    # We /etc/login.defs

SU_WHEEL_ONLY yes

Guess you like

Origin www.cnblogs.com/leisurelyRD/p/11759339.html