When you finish installing CENTOS7, sudo is not enabled by default, and sudo should be set first.
Sudo is the role of the current non-root user in the use of the command without permission, directly before the command to add sudo, enter their current user's password to complete the root user function, and do not have to use Su-back and forth to switch users. Sudo's configuration file is located in/etc/sudoers and requires root permission to read and write.
Locate the root all= (all) all line and add a line at the end (without the quotation marks):
"Username all= (All) All"
Where username is the specified user using sudo, the space within the quotation marks is tab
If you want to prompt you to enter the root password every time you use the sudo command, move to this line:
#%wheel all= (All) all
Unblock # comment
If you do not want to prompt you to enter and password each time you use the sudo command, move to the following line:
#%wheel all= (All) Nopasswd:all
Unblock # comment
Exit after saving
To add a user name to the wheel user group:
USERMOD-G Wheel Username
Ubuntu sudo password free
sudo password free:$ sudo vi/etc/sudoers%sudo all= (all:all) nopasswd:all%admin all= (All) Nopasswd:all----------------- ------------------------from http://www.cnblogs.com/yudar/p/4425518.html
CENTOS7 disable each sudo need to enter a password