The newly added hadoop user in Ubuntu cannot execute commands through sudo. the prompt is hadoopisnotinthesudoersfile... to solve this problem, you only need to switch to another user who can execute sudo and modify the/etc/sudoers file. however, be careful when modifying this file ,...
The newly added hadoop user in Ubuntu cannot execute the command through sudo. the prompt is:
Hadoop is not in the sudoers file...
To solve this problem, you only need to switch to another user who can execute sudo and modify the/etc/sudoers file. however, be careful when modifying this file. the default permission is 440, so we need to change the permission. after modifying the file, we can change the permission back.
Note the following when downgrading sudoers files:
Use sudo su-to completely switch to the root, otherwise it will not work
Run the following command:
$ Sudo su-
# Chmod a + w/etc/sudoers
# Vi/etc/sudoers
# Chmod a-w/etc/sudoers
$ Sudo su-
# Chmod a + w/etc/sudoers
# Vi/etc/sudoers
# Chmod a-w/etc/sudoers
After vi/etc/sudoers, add:
Hadoop ALL (ALL) ALL
Save and exit. hadoop is the user name that needs to grant sudo execution permission.
Another method to modify the sudoers file is available in many places on the Internet:
Restart Ubuntu, press Esc or Shift to enter the grub boot menu, select recovery mode, and select root to log on. then, you can modify the sudoers file permissions.
If sudo cannot be used by all users on the system, this method would have to be used.
Author bhq2010