0% found this document useful (0 votes)
42 views

Local System Administration Creating Local User Groups

The document discusses how to create and manage local user groups on Linux systems. It describes commands to add, modify, and remove groups. It provides an example scenario of creating a new group to collaborate on shared files, changing the group name, and removing the group.

Uploaded by

dimoni_et
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

Local System Administration Creating Local User Groups

The document discusses how to create and manage local user groups on Linux systems. It describes commands to add, modify, and remove groups. It provides an example scenario of creating a new group to collaborate on shared files, changing the group name, and removing the group.

Uploaded by

dimoni_et
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Creating Local User

Groups

A Linux Foundation Training Publication


www.training.linuxfoundation.org
(c) Copyright the Linux Foundation 2015. All rights reserved.

Local System Administration - Creating Local User Groups

Overview
Groups are an important way of managing users abilities to access, write, and execute files
on a Linux system. Adding a user to the correct group can enable them to do things like
read web server logs without allowing the user to modify the logs. Appropriately managing
groups for multiple users along with file permissions can enable users to collaboratively
edit files. On systems where su or sudo access are not available, newgrp and sg tools can
be used to run tasks with a different group if elevated privileges are required. Creating and
managing groups is usually only done as root.

Key Ideas
GID: numeric value of a groups ID
groups: command to show a users group memberships
groupadd: tool to add groups to a Linux system
groupmod: tool to modify groups on a Linux system
groupdel: tool to remove groups on a Linux system
/etc/group: File where group information is stored
/etc/gshadow: File where secure group information is stored

Example Scenario
Create a new group in order to collaborate with other users on a system. Create an example
directory with some files in it such that group members can collaboratively edit the files.
Finally, remove the group from the system.

Now Do It
1. Create a group called developers with GID 5000
2. Create a directory called shared-files
3. Make a few empty files inside the shared-files directory
4. Change the group ownership of the directory and files inside it to developers
5. Check that the files and directory have the correct ownership
6. Now rename the group to devs

42

Local System Administration - Creating Local User Groups

7. Check the files and directory ownership again


8. Ensure that members of the developers group can write to the directory and files
9. Remove the devs group

If you remember nothing else...


groupadd is used to create a new group on a system. groupmod is used to change a group
name or GID. Groupdel is used to delete a group.

43

Local System Administration - Creating Local User Groups

Answer Key
1. # groupadd -g 5000 developers
2. # mkdir shared-files
3. # touch shared-files/test1.txt; touch shared-files/test2.txt; touch shared-files/test3.
txt
4. # chgrp -Rv developers shared-files
5. # ls -alh shared-files
6. # groupmod -n devs developers
7. # ls -alh shared-files
8. # chmod g+rwx shared-files; chmod g+rw shared-files/*
9. # groupdel devs

44

Get Certified!
Get more information at http://training.linuxfoundation.org/certification/lfcs

You might also like