]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man5/passwd.5
SEE ALSO: Add getgrent(3), getgrnam(3).
[thirdparty/man-pages.git] / man5 / passwd.5
CommitLineData
fea681da
MK
1.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), Fri Apr 2 11:32:09 MET DST 1993
2.\"
3.\" This is free documentation; you can redistribute it and/or
4.\" modify it under the terms of the GNU General Public License as
5.\" published by the Free Software Foundation; either version 2 of
6.\" the License, or (at your option) any later version.
7.\"
8.\" The GNU General Public License's references to "object code"
9.\" and "executables" are to be interpreted as the output of any
10.\" document formatting or typesetting system, including
11.\" intermediate and printed output.
12.\"
13.\" This manual is distributed in the hope that it will be useful,
14.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
15.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16.\" GNU General Public License for more details.
17.\"
18.\" You should have received a copy of the GNU General Public
19.\" License along with this manual; if not, write to the Free
20.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
21.\" USA.
22.\"
23.\" Modified Sun Jul 25 10:46:28 1993 by Rik Faith (faith@cs.unc.edu)
24.\" Modified Sun Aug 21 18:12:27 1994 by Rik Faith (faith@cs.unc.edu)
25.\" Modified Sun Jun 18 01:53:57 1995 by Andries Brouwer (aeb@cwi.nl)
26.\" Modified Mon Jan 5 20:24:40 MET 1998 by Michael Haardt
27.\" (michael@cantor.informatik.rwth-aachen.de)
69289f8a 28.TH PASSWD 5 1998-01-05 "Linux" "Linux Programmer's Manual"
fea681da
MK
29.SH NAME
30passwd \- password file
31.SH DESCRIPTION
32.B Passwd
33is a text file, that contains a list of the system's accounts,
34giving for each account some useful information like user ID,
35group ID, home directory, shell, etc.
36Often, it also contains the encrypted passwords for each account.
37It should have general read permission (many utilities, like
38.BR ls (1)
18701562 39use it to map user IDs to usernames), but write access only for the
fea681da
MK
40superuser.
41.PP
42In the good old days there was no great problem with this general
c13182ef
MK
43read permission.
44Everybody could read the encrypted passwords, but the
fea681da 45hardware was too slow to crack a well-chosen password, and moreover, the
c13182ef
MK
46basic assumption used to be that of a friendly user-community.
47These days many people run some version of the shadow password suite, where
fea681da 48.I /etc/passwd
c13182ef 49has asterisks (*) instead of encrypted passwords,
30f7100e 50and the encrypted passwords are in
fea681da
MK
51.I /etc/shadow
52which is readable by the superuser only.
53.PP
54Regardless of whether shadow passwords are used, many sysadmins
30f7100e 55use an asterisk in the encrypted password field to make sure
fea681da 56that this user can not authenticate him- or herself using a
6387216b
MK
57password.
58(But see the Notes below.)
fea681da 59.PP
30f7100e 60If you create a new login, first put an asterisk in the password field,
fea681da
MK
61then use
62.BR passwd (1)
63to set it.
64.PP
65There is one entry per line, and each line has the format:
66.sp
67.RS
68account:password:UID:GID:GECOS:directory:shell
69.RE
70.sp
71The field descriptions are:
fea681da
MK
72.RS
73.TP 1.0in
74.I account
c13182ef
MK
75the name of the user on the system.
76It should not contain capital letters.
fea681da
MK
77.TP
78.I password
f81fb444 79the encrypted user password, an asterisk (*), or the letter \(aqx\(aq.
30f7100e
MK
80(See
81.BR pwconv (8)
f81fb444 82for an explanation of \(aqx\(aq.)
fea681da
MK
83.TP
84.I UID
85the numerical user ID.
86.TP
87.I GID
88the numerical primary group ID for this user.
89.TP
90.I GECOS
91This field is optional and only used for informational purposes.
18701562 92Usually, it contains the full username.
c13182ef 93GECOS means General Electric
fea681da 94Comprehensive Operating System, which has been renamed to GCOS when
c13182ef
MK
95GE's large systems division was sold to Honeywell.
96Dennis Ritchie has reported: "Sometimes we sent printer output or
97batch jobs to the GCOS machine.
98The gcos field in the password file was a place to stash the
99information for the $IDENTcard.
100Not elegant."
fea681da
MK
101.TP
102.I directory
a96050c6
MK
103the user's
104.B $HOME
105directory.
fea681da
MK
106.TP
107.I shell
108the program to run at login (if empty, use
8478ee02 109.IR /bin/sh ).
fea681da
MK
110If set to a non-existing executable, the user will be unable to login
111through
112.BR login (1).
113.RE
2b2581ee
MK
114.SH FILES
115.I /etc/passwd
19c98696 116.SH NOTES
fea681da
MK
117If you want to create
118user groups, their GIDs must be equal and there must be an entry in
119\fI/etc/group\fP, or no group will exist.
120.PP
30f7100e 121If the encrypted password is set to an asterisk, the user will be unable
fea681da
MK
122to login using
123.BR login (1),
124but may still login using
125.BR rlogin (1),
126run existing processes and initiate new ones through
127.BR rsh (1),
49ec013c 128.BR cron (8),
fea681da 129.BR at (1),
c13182ef
MK
130or mail filters, etc.
131Trying to lock an account by simply changing the
fea681da
MK
132shell field yields the same result and additionally allows the use of
133.BR su (1).
fea681da
MK
134.SH "SEE ALSO"
135.BR login (1),
136.BR passwd (1),
137.BR su (1),
138.BR group (5),
139.BR shadow (5)