# -+- number -+- category -+- title -+- email -+- name -+- homepage -+- clickOnName -+- language -+- image -+- browser-used -+- security-cookie
=0 -+- 2000-11-16:2 -+- System Administration -+- Blocking anyone to su to root -+- yenigul@cslab.itu.edu.tr -+- Ismail YENIGUL -+- http://apache.cslab.itu.edu.tr -+- nolink -+- English -+- -+- Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt; sureseeker.com) -+- 403
The su (Substitute User) command allows you to become other existing
users on the system. For example you can temporarily
become "root" and execute commands as the super-user "root". If
you don't want anyone to su to root or restrict "su" command to
certain users then add the following two lines to the top of
your "su" configuration file in the "/etc/pam.d/" directory.
1- Edit the su file (vi /etc/pam.d/su) and add the following two
lines to the top of the file:
auth sufficient /lib/security/pam_rootok.so debugAfter adding the two lines above, the "/etc/pam.d/su" file should
auth required /lib/security/pam_wheel.so group=wheel
root# usermod -G10 usernameOk, now everybody can not be root using su. When an user that is not in wheel group runs su command ,he/she can not be root even if he/she writes correct root password.