Issues related to sudo rights management for Linux systems

Source: Internet
Author: User

I learned Linux operations, after watching Oldboy video tutorial, to learn the knowledge to summarize, knowledge content are from Oldboy video tutorial.

#########################################################################################

Linux system, only the root user can add and delete users, and in the work, if there are many operations and maintenance engineers as ordinary users, we hope that a part of the ordinary users can be implemented only under the root user operation, But not able to do all of the root with the ability to do things (such as we do not want ordinary users can change the root password, but also want ordinary users to add users), this time we need to use sudo rights management.


Assign permissions to the normal user under root. Enter Command Visudo

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/86/07/wKiom1ey1gDg7NZQAADDaSYVp0Y121.png "title=" 1.png " alt= "Wkiom1ey1gdg7nzqaaddasyvp0y121.png"/>

Add Oldboy all= (All) User/sbin/useradd,uesr/sbin/userdel below line 82 to allow normal users to add and remove users. Note that when we execute this command, we must precede sudo like sudo user/sbin/useradd KKK

This is like the Emperor Root gave the Minister Oldboy a Imperial sword, Oldboy perform official duties need to take out this imperial sword to work.


Work, the leader as the user needs a large permission, we can add a permission leader All= (All) all so leader can go with sudo way into the root user sudo su-root, need to enter leader own password. Set leader user's password, enter the command under root user passwd leader enter the password. or leader All= (all) Nopasswd:all so you don't need a password to switch to the root user with sudo su-root.


Query what permissions the current user has sudo-l

View the full path of the Useradd command which Useradd

View Environment variables Echo $PATH

Why is the command required to use the full path? The reason is that there is no path to the command in the environment variable, such as the path of the Useradd command User/sbin in the environment variable, so we can use the Useradd KKK command directly to the user, there is no need for User/sbin/useradd KKK. Note that the root user's $path is not the same as the normal user's $path. For example, the path of the ifconfig command/sbin,root the user's environment variable/sbin, and the ordinary user Oldboy not, so Oldboy users can not directly use the Ifconfig command, how to solve it?

Enter the command VI. Bash_profile, and then modify the path path (add after path: Sbin (separated by a colon)), and finally enter the source. Bash_profile Reload to take effect.


This article is from the "11961592" blog, please be sure to keep this source http://11971592.blog.51cto.com/11961592/1839442

Issues related to sudo rights management for Linux systems

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.