OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man5 / passwd.5
1 .\" Copyright (c) 1993 Michael Haardt (michael@moria.de),
2 .\"     Fri Apr  2 11:32:09 MET DST 1993
3 .\"
4 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
9 .\"
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
14 .\"
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 .\" GNU General Public License for more details.
19 .\"
20 .\" You should have received a copy of the GNU General Public
21 .\" License along with this manual; if not, see
22 .\" <http://www.gnu.org/licenses/>.
23 .\" %%%LICENSE_END
24 .\"
25 .\" Modified Sun Jul 25 10:46:28 1993 by Rik Faith (faith@cs.unc.edu)
26 .\" Modified Sun Aug 21 18:12:27 1994 by Rik Faith (faith@cs.unc.edu)
27 .\" Modified Sun Jun 18 01:53:57 1995 by Andries Brouwer (aeb@cwi.nl)
28 .\" Modified Mon Jan  5 20:24:40 MET 1998 by Michael Haardt
29 .\"  (michael@cantor.informatik.rwth-aachen.de)
30 .TH PASSWD 5 2015-02-01 "Linux" "Linux Programmer's Manual"
31 .SH NAME
32 passwd \- password file
33 .SH DESCRIPTION
34 The
35 .IR /etc/passwd
36 file is a text file that describes user login accounts for the system.
37 It should have read permission allowed for all users (many utilities, like
38 .BR ls (1)
39 use it to map user IDs to usernames), but write access only for the
40 superuser.
41 .PP
42 In the good old days there was no great problem with this general
43 read permission.
44 Everybody could read the encrypted passwords, but the
45 hardware was too slow to crack a well-chosen password, and moreover the
46 basic assumption used to be that of a friendly user-community.
47 These days many people run some version of the shadow password suite, where
48 .I /etc/passwd
49 has an \(aqx\(aq character in the password field,
50 and the encrypted passwords are in
51 .IR /etc/shadow ,
52 which is readable by the superuser only.
53 .PP
54 If the encrypted password, whether in
55 .I /etc/passwd
56 or in
57 .IR /etc/shadow ,
58 is an empty string, login is allowed without even asking for a password.
59 Note that this functionality may be intentionally disabled in applications,
60 or configurable (for example using the "nullok" or "nonull" arguments to
61 pam_unix.so).
62 .PP
63 If the encrypted password in
64 .I /etc/passwd
65 is "\fI*NP*\fP" (without the quotes),
66 the shadow record should be obtained from an NIS+ server.
67 .PP
68 Regardless of whether shadow passwords are used, many system administrators
69 use an asterisk (*) in the encrypted password field to make sure
70 that this user can not authenticate him- or herself using a
71 password.
72 (But see NOTES below.)
73 .PP
74 If you create a new login, first put an asterisk (*) in the password field,
75 then use
76 .BR passwd (1)
77 to set it.
78 .PP
79 Each line of the file describes a single user,
80 and contains seven colon-separated fields:
81 .sp
82 .RS
83 name:password:UID:GID:GECOS:directory:shell
84 .RE
85 .sp
86 The field are as follows:
87 .TP 12
88 .I name
89 This is the user's login name.
90 It should not contain capital letters.
91 .TP
92 .I password
93 This is either the encrypted user password,
94 an asterisk (*), or the letter \(aqx\(aq.
95 (See
96 .BR pwconv (8)
97 for an explanation of \(aqx\(aq.)
98 .TP
99 .I UID
100 The privileged
101 .I root
102 login account (superuser) has the user ID 0.
103 .TP
104 .I GID
105 This is the numeric primary group ID for this user.
106 (Additional groups for the user are defined in the system group file; see
107 .BR group (5)).
108 .TP
109 .I GECOS
110 This field (sometimes called the "comment field")
111 is optional and used only for informational purposes.
112 Usually, it contains the full username.
113 Some programs (for example,
114 .BR finger (1))
115 display information from this field.
116 .IP
117 GECOS stands for "General Electric Comprehensive Operating System",
118 which was renamed to GCOS when
119 GE's large systems division was sold to Honeywell.
120 Dennis Ritchie has reported: "Sometimes we sent printer output or
121 batch jobs to the GCOS machine.
122 The gcos field in the password file was a place to stash the
123 information for the $IDENTcard.
124 Not elegant."
125 .TP
126 .I directory
127 This is the user's home directory:
128 the initial directory where the user is placed after logging in.
129 The value in this field is used to set the
130 .B HOME
131 environment variable.
132 .TP
133 .I shell
134 This is the program to run at login (if empty, use
135 .IR /bin/sh ).
136 If set to a nonexistent executable, the user will be unable to login
137 through
138 .BR login (1).
139 The value in this field is used to set the
140 .B SHELL
141 environment variable.
142 .SH FILES
143 .I /etc/passwd
144 .SH NOTES
145 If you want to create user groups, there must be an entry in
146 .IR /etc/group ,
147 or no group will exist.
148 .PP
149 If the encrypted password is set to an asterisk (*), the user will be unable
150 to login using
151 .BR login (1),
152 but may still login using
153 .BR rlogin (1),
154 run existing processes and initiate new ones through
155 .BR rsh (1),
156 .BR cron (8),
157 .BR at (1),
158 or mail filters, etc.
159 Trying to lock an account by simply changing the
160 shell field yields the same result and additionally allows the use of
161 .BR su (1).
162 .SH SEE ALSO
163 .BR chfn (1),
164 .BR chsh (1),
165 .BR login (1),
166 .BR passwd (1),
167 .BR su (1),
168 .BR crypt (3),
169 .BR getpwent (3),
170 .BR getpwnam (3),
171 .BR group (5),
172 .BR shadow (5)
173 .SH COLOPHON
174 This page is part of release 3.79 of the Linux
175 .I man-pages
176 project.
177 A description of the project,
178 information about reporting bugs,
179 and the latest version of this page,
180 can be found at
181 \%http://www.kernel.org/doc/man\-pages/.