Command Syntax:
sudo adduser <username> sudo
Example:
The following command will create a new user jack and add it to sudo group. If user already exist, it will simply add them to sudo group.$ sudo adduser jack sudo
Add Existing User in sudo Group
You can also use the following command to add existing users to group sudo, where it will get full sudo privileges.$ sudo usermod -aG sudo <username>
Remove Existing User from sudo Group
The following command will remove user from group sudo. This will not remove user from system.$ sudo gpasswd -d <username> sudo
Comments
Post a Comment