Last week I decided to run a little competition to see your tips related to UNIX and Linux. A massive thank you to all that have participated.
There were total 185 entries. Many entries were nice and I really enjoyed reading all of them. But, there can only be 3 winners (randomly selected):
=> Hunter Perrin
There were many other great entries and I recommend you to check them out in the comments section.
Next month I will announce another small competition. If any one is interested sponsoring or would like give away as a prize in a competition, please contact me. Sysadmin because even developers need heroes!!!
su is used to become another user during a login session. Invoked without a username, su defaults to becoming the super user. The user will be prompted for a password, if appropriate. Invalid passwords will produce an error message. All attempts, both valid and invalid, are logged to detect abuses of the system.
By default almost all distro allows to use su command. However you can restrict the use of su command for security reasons.
Both UNIX and Linux have a group called wheel. If user is member of this group she can use su command. We can add user to this group.
For example add existing user rocky to wheel group
# usermod -G wheel rocky
Now open /etc/pam.d/su PAM config file:
# vi /etc/pam.d/su
Append line as follows:
auth required /lib/security/pam_wheel.so use_uid
auth required pam_wheel.so use_uid
Save and close the file.
Because of above setting only members of the administrative group wheel can use the su command. However I still recommend sudo over su for better control, security and ease of use. This is also default behavior on FreeBSD.