Groups Management
groupadd
groupadd group_name
- create new groupgroup_name
groupdel
groupdel group_name
- delete groupgroup_name
groupmod
- modify some group
groupmod --new-name new_group_name group_name
- renamegroup_name
tonew_group_name
/etc/group
file
- contains the information related to the groups on the system
- format -
group_name:password:gid:members
/etc/gshadow
- contains the information regarding the passwords for the groups
- format -
group_name:password:group_administrator:group_members
gpasswd
- add new member to a group
gpasswd -A member_name group_name
- add member
member_name
to groupgroup_name
as group administrator -A
signifies group administrator
- add member
usermod -aG group_name user_name
-a
append-G
group- add user
user_name
to groupgroup_name
as a member
usermod -a group_name user_name
- add
group_name
group to the useuser_name
- add
power of group administrators
Suppose a user is group administrator of group1
then
gpasswd -a user_name group1
- adduser_name
togroup1
getent group group1
- get the details of the groupgroup1
gpasswd -d user_name group1
- removeuser_name
fromgroup1
gpasswd group1
- set the password for thegroup1
newgrp
- temporarily add a group to your user
newgrp grpname
- you will need group password for this