# usermod -a -G sudo <username>
The -a flag specifies that the user should be added to a group. The -G flag is used to specify which group the user should be added to, in this case it is the sudo group.
Alternatively, the adduser command can be used to accomplish the same objective
# adduser <username> sudo
This will add the specified user to the specified group.
To remove a user from the sudo group, run the deluser command
# deluser <username> sudo
It should be noted that only root has permission to manage the sudo group, so these commands will have to be performed either by a user who already has sudo powers, or by the root user.
Post a Comment