Because the root user has full operation permissions on the system, in order to avoid some mistakes, we recommend that you log on to the system as a general user. if necessary, you need root operation permissions, then, run the "su-" command to log on as the root user. Generally, you can log on as the root user to configure the system as administrator by executing the "su-" command and entering the correct root password. However, to further enhance the security of the system, it is recommended that you log on to the system as a general user to avoid incorrect operations because the root user has full permissions on the system, if necessary, you must use the "su-" command to log on as the root user.
Generally, you can log on as the root user to configure the system as administrator by executing the "su-" command and entering the correct root password. However, in order to further enhance the security of the system, it is necessary to establish an administrator group that only allows users in this group to execute the "su-" command to log on as the root user, users in other groups cannot log on as root even if they execute "su-" and enter the correct root password. In UNIX, the group name is usually "wheel ".
First, we create two common users, tom john.
[Root @ www ~] # Useradd tom
[Root @ www ~] # Passwd tom
Enter your password
[Root @ www ~] # Useradd john
[Root @ www ~] # Passwd john
Enter your password
Reference [root @ www ~] # Usermod-g wheel tom add the tom user to the wheel Group
[Root @ www ~] # Vi/etc/pam. d/su Hei open this configuration file and find this sentence
# Comment out the above in the sixth line
# Auth required pam_wheel.so use_uid
Run:
[Root @ www ~] # Echo "SU_WHEEL_ONLY yes">/etc/login. defs
Then you can log in with tom and john respectively. if you are not added to the wheel Group, run the "su-" command. even if you enter the correct root password, you cannot log on as the root user.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service