User isn't in the sudoers solution

Source: Internet
Author: User
Tags chmod


Use sudo to prompt "xxx is isn't in" Sudoers file. This incident would be reported. where xxx is your username, that is, your username does not have permission to use sudo, we just need to modify the/etc/sudoers file. Here's how to modify it:

1 into Super User mode. That is, the input "Su-", the system will let you enter the superuser password, enter the password after entering the Super User mode. (Of course, you can also use root directly)
2 Write permission to add files. That is, the input command "chmod u+w/etc/sudoers".

Note: The/etc/sudoers file is a read-only file
3) Edit the/etc/sudoers file. That is, enter the command "Vim/etc/sudoers", enter "I" into edit mode, find this line: "Root all= (All)" Add "xxx all= (All) all" (Here xxx is your username), and then save (the first one The ESC key and enter ": Wq" to exit.
4 Revoke file Write permission. That is, the input command "chmod u-w/etc/sudoers".

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.