7. User Administration


User Administration:
Two Types
1. Users           2. Groups
1. User:  user creation, types, syntax checkout on next post...
2. Group: It is a collection of users who can share the files and other system resources.
group consist of 
1. Group Name
2. Group ID &
3. List of users in the group

when you create a group, by default one file gets updated automatically. i.e.
/etc/group

types of group:
1. primary group: It is a group to which the user must belong to without primary group we cannot create a user.
The user cannot have more than one primary group.
2. secondary group: It is a group to which the user can also belong to and the user can belong to 16 secondary groups.

Group ID: There are two different types of group ID's from 0-99 are system defined and 100-60,000 are user defined.
Note: 
1. When you create a group we need to specify the group name and group ID.
2. Whereas 'group name' for administration reference and 'group id' for kernel reference.
3. group id's over 60,000 will not be having full functionalities.

Syntax to create a group:
# groupadd -g <gid> <group name>
ex: groupadd -g 777 sona
// sona group created with '777 group id'. when a group create /etc/group defaultly updated.

# cat /etc/group                  // to see the group details

We can create without '-g':
# groupadd gramsci                 //here gid=1010, because already highest value gid=1009 assigned
# groupadd hi
# groupadd -g 2000 hey            // now what is gid = 2000
# groupadd bye                         //now gid= 2001, because highest value gid is 2000

Note: When you create a group with specifying gid it will take the increment value of the highest user assigned gid.