Add users to sudoers under Linux

Source: Internet
Author: User

Linux defaults to not adding users to the Sudoers list, and requires root to manually add the account to the Sudoers list for the normal account to execute the sudo command.

Root account type visudo to enter sudo configuration, this command is much better than vim/etc/sudoers, because using Visudo for sudo configuration, you will get a lot of hints.

After typing Visudo, type/root in the editor to find root, and locate the third root line

Root all= (All) all

Press YYP to copy and paste on the next line, enter CW at root of this line to replace root with the account name you need to add the user, such as blinux, the result is

Root all= (All) all
Blinux all= (All) all

If you do not need to enter a password when you want to execute the sudo command later, you can type

Root all= (All) all
Blinux all= (All) Nopasswd:all

Input: Wq save.

After executing the sudo command, type the sudo space directly at the front of the command, such as Sudo shutdown-h now to execute the immediate shutdown command.

If you need to enter a password, enter the user's password instead of the root password.

Note: If the user is not in the Sudoers list, you will get the following prompt.

Blinux is not in the sudoers file. This incident would be reported.

-------------------------------------------------------------------------------------------

Transferred from: http://blog.sina.com.cn/s/blog_6be3556a0101f4kf.html

Add users to sudoers under Linux

Related Article

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.