Group Administration
10:12 AM
By
Rajashekar Reddy BusiReddy
RHCE
0
comments
Group Administration
Linux
uses groups to define a set of related user accounts that can share access to a
file or directory.
Important points:
A user can
be participant to more than one group at the same time.
A user who
is member of a group can change to that group without password but when
a user was not member can
only change to that group if the group password exist and the
user gives it.
One
or more users can become group
administrators for specific groups.
Group Administrators can:
·
add/change/delete the password of the group
·
add/delete users to the group
·
reserve the group to members only
Types of groups
There are
two types of groups. They are
Primary group: These
groups are created automatically when user was created.
Secondary group: these
groups are created by the admin manually.
The groups configuration files:
/etc/group: Where
all the users for each groups are listed.
groupname: Password
or x or ! : GID: Memberlist
/etc/gshadow: Where the groups passwords are kept
Format:
groupname : Password or !
: AdminUsersList : MemberUsersList
To create a new group,
use the groupadd command:
groupadd group
where group specifies the name of the
group to be added. Groups are stored in the file /etc/group, which can be read by any user but modified only by root.
Options:
-g gid for users
-o to override
To delete a group, user
the groupdel command.
groupdel group
where group specifies the name of the
group to be deleted.
Group membership
To add user or delete users to group we use the
gpasswd command
gpasswd [options] group
where group specifies the name of the
group to be assigned to users
Options:
a user Adds
permanently a user to a group
d user
Deletes permanently a user from a group.
-A adds a
group administrator
-M adds
multiple users to the group
Modifying a group
groupmod command is used to modify the group
contents
groupmod [options] group
where group specifies the name of the
group to be modified
options
-n to assign new name for group
-p to change password
-g to change gid
Examples:
groupadd -g 600
Student
groupmod –g 700 student
groupmod –n teachers
student
gpasswd -M raju koti Student
gpasswd –d raju Student
gpasswd –a raju Student
groupdel Student
Leave Your Comment Below If You Like This Post
0 comments: