Group Administration

New groups may be created by hand editing the file /etc/group or by using groupadd. The basic syntax for groupadd is very simple 
            # groupadd groupname
groupdel is used in a similar fashion to remove groups;
            # groupdel  groupname 
# groupmod can be used, among other things, to change the name of group;
            #  groupmod -n newname oldname
For example, if several users are members of the subject group and a root user issues the following command, the group will be changed to class and all the same members will remain;
            # groupmod -n subject class
/etc/group contains one group per line;
        ram:X;501;laxman,krishna,ravi,ramesh
The first field is the name of the group. The second field is the group password, or an "x" when using shadow passwords. The third field is the unique group ID. the fourth field is a comma-separated list of group memebers.
In order to avoid using a GID with in the range typically assigned to user private separated list of group memebers.
In  order to avoid using  a GID within the  range  typically  assigned to users and their private groups,use -r 
            #groupadd -r groupname
gpasswd can be used to define group members in /etc/group, group administrators, and to create or change group passwords in /etc/gshadow, if desired.

0 comments:

Post a Comment