TP Linux Notion Groupe
TP Linux Notion Groupe
Objective:
Learn how to create groups, add users to groups, and manage group memberships using Linux
commands.
1. Create a group:
bash
o Check if the group has been successfully created by listing all groups.
bash
o Add two new users alice and bob using the useradd command (without home
directories for simplicity).
bash
bash
bash
Copy code
groups alice
groups bob
o To remove alice from the team group, use the gpasswd command.
Bash
2. Verify removal:
bash
groups alice
o Create a directory called shared_folder that will be owned by the team group.
bash
o Use the chown command to set team as the group owner of the shared_folder.
3. Set permissions so only the team group can access the directory:
o Use the chmod command to give the team group read, write, and execute
permissions on the folder.
bash
o Check the permissions of the directory to ensure that they are set correctly.
bash
ls -ld /shared_folder
Part 5: Deleting a Group
o If you no longer need the group, delete it using the groupdel command.
bash
bash
Summary of Commands: