Verify sudo group with groups command
In the previous step, you saw in the /etc/sudoers
file that members of the sudo
group have full sudo
privileges. In this step, you will verify that the labex
user is indeed a member of the sudo
group using the groups
command.
The groups
command displays the names of the primary and supplementary groups for each given username, or for the current process if no username is given.
Type the following command in your terminal and press Enter:
groups
You should see output similar to this, listing the groups that the labex
user belongs to:
labex sudo ssl-cert public
This output shows that labex
is a member of the labex
, sudo
, ssl-cert
, and public
groups. The presence of sudo
in the list confirms that the labex
user is part of the group that is granted sudo
privileges according to the /etc/sudoers
file.
Alternatively, you can specify the username with the groups
command:
groups labex
The output will be the same:
labex : labex sudo ssl-cert public
This step reinforces the connection between group membership and sudo
privileges as configured in the system.
Click Continue to complete this lab.