WHAT IS A GROUP? How to Managing and Creating Linux Group?
A group is a collection of users that need to share access to files and other system resources.
Groups can be used to grant
access to files to a set of users instead of just a single user.
Like users, groups have group
names to make them easier to work with. Internally, the system
distinguishes groups by the
unique identification number assigned to them, the group ID or GID.
The mapping of group names to
GIDs is defined in databases of group account information. By
default, systems use the
/etc/group file to store information about local groups.Each line in the
/etc/group file contains information about one group. Each group entry is
divided into four colon-separated fields. Here is an example of a line from /etc/group:
Best Linux Training Institute in Noida...
group01:x:10000:user01,user02,user03
● Group name for this group (group01).
● Obsolete group password field. This field should always be x.
● The GID number for this group (10000).
● A list of users who are members of this group as a supplementary group (user01, user02,user03). Primary (or default) and supplementary groups are discussed later in this section.
Creating Groups from the
Command Line
The groupadd command creates groups. Without options the groupadd command uses the next available GID from the range specified in the /etc/login.defs file while creating the
groups.
[user01@host ~]$ sudo groupadd 10000 group01
Deleting Groups from the
Command Line
• The groupdel command removes groups.
[user01@host ~]$ sudo groupdel group0022
Modifying Existing Groups from the Command Line
• The groupmod command changes the properties of an
existing group. The -n option specifies a
new name for the group.
[user01@host
~]$ sudo groupmod -n group0022 group02
• The -g option specifies a new GID.
[user01@host ~]$ sudo groupmod -g 20000 group0022
Get More Information About Linux Training and Certification Course Visit Here.
Thank You For Reading
Written By Jitendar Kumar
Comments
Post a Comment