π«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
addusercommand 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 user42sudo adduser gemartin sudoVerify group membership: Once completed, we can verify the user has been added to the groups using:
getent group sudo user42This command will show the groups sudo and user42 with our user listed as a member.
Last updated
Was this helpful?