๐ซAdding a user to a group
How to add users to groups
Add user to group: We can add a user to a group using the
adduser
command with this syntax:
sudo adduser <username> <groupname>
For our Born2BeRoot project, we need to add our user to both the sudo
and user42
groups:
sudo adduser gemartin user42
sudo adduser gemartin sudo
Verify group membership: Once completed, we can verify the user has been added to the groups using:
getent group sudo user42
This command will show the groups sudo
and user42
with our user listed as a member.


Last updated
Was this helpful?