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.