User / user group sudo privileges

1. Switch to the root user, the switch would not have said how it would not go themselves Baidu.

2. Add file write access to sudo, the command is:
chmod + U w / etc / sudoers

3. Edit the sudoers file
vi / etc / sudoers
find the line root ALL = (ALL) ALL, add xxx ALL = (ALL) ALL ( xxx here is your user name) in his following

ps: here you can say at sudoers add the following four lines in any one
ALL = youuser (ALL) ALL
% youuser ALL = (ALL) ALL
youuser ALL = (ALL) the NOPASSWD: ALL
% youuser ALL = (ALL) the NOPASSWD: ALL

first line: allows the user to execute youuser sudo command (password required).
the second line: allows the user to perform user group youuser inside sudo command (password required).
the third line: allows the user to execute youuser sudo command, and does not enter a password at the time of execution.
fourth row: allows the user to set inside youuser user executes sudo command, and do not enter the password in the course of implementation.

4. undo sudoers file write permissions, the command:
chmod UW / etc / sudoers

so that ordinary users can use the sudo.

Guess you like

Origin www.cnblogs.com/longqin/p/11620801.html