Add sudoer in Linux

Source: Internet
Author: User

Add a user to sudoer list

By default, users are not added to the sudoers list in Linux. You need to manually add the account to the sudoers list by the root user so that the normal account can execute the sudo command.

The root account can enter the sudo configuration by typing mongodo. This command is much better than Vim/etc/sudoers, because using mongodo for sudo configuration will receive many prompts.

After you type export do, type/root in the editor to find the root line and find the third root line.

Root all = (all) All

Press yyp to copy and paste the next line. Enter CW at the root of this line to replace root with the account name of the user you want to add. For example, in blinux, the result is:

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

If you do not need to enter the password when executing the sudo command, it can be shown

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

Enter: WQ to save.

Then, when executing the sudo command, enter a sudo space in the front-end of the command. For example, sudo shutdown-H now executes the immediate shutdown command.

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

Note: If the user is not in the sudoers list, the following message is displayed.

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

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.