Reference Blog: http://xvshell.iteye.com/blog/1838093
1. When the user executes sudo, the Linux system will look for the/etc/sudoers file, and it is active to determine if the user has permission to execute the sudo command
2. If the user has the ability to execute sudo, let the user enter their own password to confirm, here is more than the password to use root, praise
3. If the password is entered correctly, start executing the shell command followed by sudo
4. If you want to switch the same identity, and the SU command, do not enter the password
Hadoop all= (Root) nopasswd:all
That's fine.
Hadoop all=(all) All
This is not to say that you do not need to enter a password, but instead of using the SU command to switch to the root account to perform the operation of the root account. For example, create a new folder under/opt test. The original operation is the SU switch to root, enter the root password, after the operation is finished, exit returns to the current account. Now only sudo mkdir/opt/test, and then enter their own password can be done, similar to the one created in Ubuntu installation of the account (with the sudo command to execute the privileges), because the first time to execute the sudo privilege command when the password entered the life cycle, So it is not necessary to enter the password again in a short time.
One afternoon was killed by this, finally in 21:45 to solve, during the two games also watched Sydney fc2:1 Guangzhou Evergrande; Shanghai Port 2:1 Suwon Samsung.
sudoers file setting sudo command no password (root password) login