Linux prohibits non-WHEEL users from using the SU command

Source: Internet
Author: 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 and Linux, the group name is usually "wheel ". 1: Add a user [root@Linuxidc.com ~] # Useradd dongee [root@Linuxidc.com ~] # Passwd dongee 2: add the dongee user to the Wheel group: [root@Linuxidc.com ~] # Usermod-G wheel dongee combine Add the general user dongee to the Administrator Group's wheel Group 3: Modify/etc/pam. d/su configuration [root@Linuxidc.com ~] # Vi/etc/pam. d/su Hei open this configuration file # auth required/lib/security/$ ISA/pam_wheel.so use_uid then find this line and remove "#" 4: Modify/etc/login. defs file [root@Linuxidc.com ~] # Echo "SU_WHEEL_ONLY yes">/etc/login. after adding a statement to the end of a row in defs partition, you can create a new user. Then, you can test the new user and find that the user is not added to the wheel group, if you run the "su-" command and enter the correct root password, you cannot log on as the root user.

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.