RedHatLinux common users cannot execute sudo to solve the problem

Source: Internet
Author: User
In RedHatLinux, when a user executes the sudo command, the system reports an error like "isnotinthesudoersfile. Thisincidentwillbereported. The reason is that the user is not automatically added to the sudo user list when the user is created by Redhat. First obtain the root permission from the Administrator, and then find out where the sudoers file is stored. Hitting command: whereissudoers &

In RedHat Linux, when you run the sudo command, the system reports an error such as "is not in the sudoers file. This incident will be reported. The reason is that the user is not automatically added to the sudo user list when the user is created by Redhat.

First obtain the root permission from the Administrator, and then find out where the sudoers file is stored. Percussion command:

The whereis sudoers system generally returns the following content:

Sudoers:/etc/sudoers/usr/share/man/man5/sudoers.5.gz the root permission is required for sudoers modification. Therefore, You need to log on to the root user:

The su-root sudoers file is read-only by default. Therefore, you must first modify the permissions of www.linuxidc.com:

Chmod u + w/etc/sudoers use vi to modify the sudoers file

Find the following line in vi/etc/sudoers:

Root ALL = (ALL) ALL if your username is yourname, add the following content below the above line:

Yourname ALL = (ALL) ALL save and exit from vi, and then modify the sudeors File Permission back:

Chmod u-w/etc/sudoers is to exit shell and then log on again.

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.