๐Ÿซ‚Adding a user to a group

How to add users to groups

  1. 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

Replace gemartin with your actual username.

  1. 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?