Linux defaults to not adding users to the Sudoers list, and requires root to manually add the account to the Sudoers list for the normal account to execute the sudo command.
Root account type visudo to enter sudo configuration, this command is much better than vim/etc/sudoers, because using Visudo for sudo configuration, you will get a lot of hints.
After typing Visudo, type/root in the editor to find root, and locate the third root line
Root all= (All) all
Press YYP to copy and paste on the next line, enter CW at root of this line to replace root with the account name you need to add the user, such as blinux, the result is
Root all= (All) all
Blinux all= (All) all
If you do not need to enter a password when you want to execute the sudo command later, you can type
Root all= (All) all
Blinux all= (All) Nopasswd:all
Input: Wq save.
After executing the sudo command, type the sudo space directly at the front of the command, such as Sudo shutdown-h now to execute the immediate shutdown command.
If you need to enter a password, enter the user's password instead of the root password.
Note: If the user is not in the Sudoers list, you will get the following prompt.
Blinux is not in the sudoers file. This incident would be reported.
-------------------------------------------------------------------------------------------
Transferred from: http://blog.sina.com.cn/s/blog_6be3556a0101f4kf.html
Add users to sudoers under Linux