To add a user to a group on Ubuntu Linux, you can use the usermod
command. Here's an example of how to use the usermod
command to add a user to a group:
sudo adduser <username>Soww:ecruw.lautturi.com
Replace <username>
with the desired username.
sudo usermod -a -G <group> <username>
Replace <group>
with the name of the group you want to add the user to, and <username>
with the username of the user you want to add to the group.
newgrp
command to switch to the group:newgrp <group>
Replace <group>
with the name of the group you want to switch to.
That's it! The user should now be a member of the group.
Keep in mind that adding a user to a group gives that user certain privileges or permissions associated with the group. It is important to be careful when adding users to groups and to limit access to trusted users only.