Modifying the consumer mode can be accomplished using the USERMOD command.
First, usermod commonly used command introduction:
-A: Use only with-G to add users to the affiliate group.
-D: Modify the user login directory, such as the normal user login, the default into the pre-set home directory, some times in order to facilitate the login need to enter a more complex path, you can use this option to set the entry-time directory.
-G: Modifies the group to which the user belongs.
-G: Modify the additional group to which the user belongs, and use this option when changing the user's sudo permissions.
-S: Modify the shell version used by the user after login
Two, sudo permissions
Users get sudo permissions and can use two ways
1. Modify the/etc/sudoers file to add the user name to the sudo permission group, for example
2. The second option is to modify the user's affiliate group:
Can be modified using USERMOD or GPASSWD
(1) Modify with Usermod
$ sudo usermod-a-g sudo tt
After the modified results can be viewed/etc/group, you can see that the sudo column contains the TT
Files that may be involved:
FILES
/etc/group
Group account information.
/etc/gshadow
Secure group account information.
/etc/passwd
User account information.
/etc/shadow
Secure user account information.
(2) using GPASSWD
Common commands:
-A: Adding users to the specified group
-D: Remove the user from the specified group
Other options:
-M sets the group member list
-A sets the list of administrators for the group
For example:
Add TT to the sudo group member:
sudo gpasswd-a tt sudo
Remove the TT from the sudo group:
sudo gpasswd-d tt sudo
Third, to solve every use of sudo need to enter a password, too much trouble.
Workaround:
Modify the/etc/sudoers file
Linux User Management (2)----Modify user mode (Usermod,sudo permissions, etc.)