Linux users cannot use the sudo command. linux users use the sudo command.

Source: Internet
Author: User

Linux users cannot use the sudo command. linux users use the sudo command.

The newly created sudo command cannot be used. The following message is displayed:

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

It turns out that the newly created user is not in the sudoers management file, so it is not enough to add it to it. The following method is used:

1. Switch to the root user.

Su root # The system will prompt you to enter the password of the root user

2. Add the sudoers file write permission.

Chmod u + w/etc/sudoers

3. Edit the sudoers file and add the corresponding content.

Vim/etc/sudoers

Find

# User privilege specificationroot ALL = (ALL: ALL) ALL

In the following example

Xiaojing ALL = (ALL: ALL) AL # xiaojing is a new user

(Note: In vim, press: I to enter edit mode. Save: Press ESC to Enter command mode, and then enter ": wq" to save and exit)

4. revoke the sudoers file permission.

Chmod u-w/etc/sudoers

Now xiaojing can use the sudo command.

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.