Professional Documents
Culture Documents
Chapter 3:
User Management
Objectives
• Examine /etc/group and /etc/passwd
• Create, modify, and delete user accounts with
useradd, usermod, and userdel
Overview
/etc/group
Where is every user
commonly
represented? /etc/passwd
root::0:root
• Field 1: name GID
• Field 2: blank or x hardly used today
• Field 3: numeric GID
• Field 4: list of user for which this is their
supplementary group
/etc/group
root user’s supplementary group
root::0:root Line 1
staff::1: Line 2
bin::2:root,bin,daemon Line 3
sys::3:root,bin,sys,adm Line 4
lp::8:root,lp,adm Line 5
O Line 1: num. GID = 0, name GID = root, supplementary group for root
user
O Line 2: num. GID = 1, name GID = staff, no user has staff as
supplementary group.
O Line 3: [fill in the blank]
O Line 4: [fill in the blank]
O Line 5: [fill in the blank]
/etc/group
• groupadd command: Adding a group
• Example: create a new group “dba” with a GID
of 241
groupadd –g 241 dba
/etc/passwd
• Store all user information except password
encryption
• /etc/passwd and /etc/shadow – use by
login and passwd programs - authentication
/etc/passwd
dc010101:x:210:241:Surizal Nazeri:/home/dc010101:bin/ksh
Password
Encryption
/etc/shadow & /etc/gshadow
• Remove user
# userdel dc010101
Options:
-g: GID
-f: This option causes to just exit with
-o: This option permits to add
success status, if the specified group
group with non-unique GID
already exists.
-r: This flag instructs groupadd to
g: If the specified GID already exists, other
add a system account
(unique) GID is chosen
Modifying group