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 default permission is 440, therefore, you need to change the permission. After modifying the file, you must change the permission back to the sudoers file. Note the following when changing the permission: Use sudosu-to thoroughly Switch
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
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.