References
Http://hi.baidu.com/xiboliya/blog/item/015ead864e041b2a67096eda.html
Body
During Ubuntu-10.10 system installation, the system prompts to create a default user, for example, the user name is: xuwei. By default, this user has certain management functions, that is, the operation with root permission can be performed through the sudo command. Because ubuntu does not allow users to log on to the system as root users, this default user is the administrator in the actual sense. Now the problem is: If you create a new user: hadoop, you need to set this user to the same administrator user as xuwei. There are two ways to achieve this problem:
- Interface mode.Log on to the system with xuwei, choose system> System Management> users and groups, select hadoop users, and change the Account type to administrator. Restart your computer and log on to the system as a hadoop user.
- Command line.Use xuwei to log on to the system and open the terminal to run:
Sudo gedit/etc/sudoers
Modify the configuration file. The modified/etc/sudoers file contains the following content. The last line is the added hadoop User:
#/Etc/sudoers # This file must be edited with the 'usually do 'command as root. # See the man page for details on how to write a sudoers file. # defaults env_reset # host alias specification # user alias specification # Cmnd alias specification # User Privilege specificationroot all = (all) all # allow members of Group sudo to execute any command # (note that later entries override this, so you might need to move # It further down) % sudo all = (all) all ## includedir/etc/sudoers. d # Members of the Admin group may gain root privileges % admin all = (all) AllHadoop all = (all) All
Restart your computer and log on to the system as a hadoop user.
PS: Create a hadoop user and add it to the hadoop group to go to the Method
First, create a hadoop group. The command is as follows:
Sudo addgroup hadoop
Create a user and add it to the hadoop group just created
Sudo adduser -- ingroup hadoop
After executing this command, we will be prompted to enter the password. If the password is entered twice and the password is the same, the user is created successfully.
If hadoop users can use the sudo command, perform the operation as described above. I am using the second method.