The Linux user database (/etc/passwd)
The Linux user account details (except password related information) are stored in a configuration file, /etc/passwd.
A sample /etc/passwd configuration file is copied below.
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
news:x:9:13:news:/etc/news:
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/sbin/nologin
rpm:x:37:37::/var/lib/rpm:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
avahi:x:70:70:Avahi daemon:/:/sbin/nologin
mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin
smmsp:x:51:51::/var/spool/mqueue:/sbin/nologin
nscd:x:28:28:NSCD Daemon:/:/sbin/nologin
vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin
haldaemon:x:68:68:HAL daemon:/:/sbin/nologin
rpc:x:32:32:Portmapper RPC user:/:/sbin/nologin
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
pcap:x:77:77::/var/arpwatch:/sbin/nologin
ntp:x:38:38::/etc/ntp:/sbin/nologin
gdm:x:42:42::/var/gdm:/sbin/nologin
xfs:x:43:43:X Font Server:/etc/X11/fs:/sbin/nologin
sabayon:x:86:86:Sabayon user:/home/sabayon:/sbin/nologin
tintin:x:500:500::/home/tintin:/bin/bash
Each column in /etc/passwd, delimited by a colon and it is explained in detail below.
Column |
Field |
Description |
1 |
Username |
User login id |
2 |
Password |
The password. You should see either an x, an asterisk (*), or an encrypted password. An x points to /etc/shadow for the actual password. An asterisk means the account is disabled. |
3 |
User ID |
The unique numeric user ID (UID) for that user. By default, Red Hat starts normal user IDs at 500. |
4 |
Group ID |
The numeric group ID (GID) associated with that user. By default, RHEL creates a new group for every new user, and the number matches the UID. |
5 |
User info |
You can enter any information of your choice in this field. Standard options include the user's full name, telephone number, e-mail address, or physical location. Also known as GECOS field. |
6 |
Home Directory |
Users home directory. RHEL places new home directories in /home/username. |
7 |
Login Shell |
Users login shell. Default Linux shell is bash shell. |