Saturday, April 2, 2022

Ubuntu/Linux: Adding a user to the sudo group

Members of the sudo group can execute any command as root user using the sudo command:

sudo date

The command above invokes the date command with root privileges.

In order to add a user to the sudo group, invoke the following from a terminal:

sudo usermod -aG sudo <username>

The leading sudo runs the usermod command as root. Depending on how a user is configured, the sudo command may prompt the user to enter a password.

To add a user named, devops, to the sudo group invoke the following command:

sudo usermod -aG sudo devops



No comments :

Post a Comment