The /etc/passwd File

The information database for the username is stored in a simple text file named /etc/passwd. This file is formatted as a number of different colon-separated fields. A small example is shown:

 root:bbCsSRB7BZfM.:0:0:root:/root:/bin/sh bin:*:1:1:bin:/bin: daemon:*:2:2:daemon:/sbin: adm:*:3:4:adm:/var/adm: lp:*:4:7:lp:/var/spool/lpd: mail:*:8:12:mail:/var/spool/mail: news:*:9:13:news:/var/lib/news: uucp:*:10:14:uucp:/var/spool/uucppublic: man:*:13:15:man:/usr/man: postmaster:*:14:12:postmaster:/var/spool/mail:/bin/sh www:*:99:103:web server:/etc/httpd:/bin/sh nobody:*:-1:100:nobody:/dev/null: ftp:*:404:1::/home/ftp:/bin/sh jan:/WzbqfJwMa/pA:503:100:Jan Hassebroek:/home/jhassebr:/bin/ksh postgres:gXQrO/hNwy5IQ:506:102:Postgres ...

Get Advanced UNIX Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.