xref: /freebsd/usr.bin/passwd/passwd.1 (revision 23f282aa31e9b6fceacd449020e936e98d6f2298)
1.\" Copyright (c) 1990, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\"    must display the following acknowledgement:
14.\"	This product includes software developed by the University of
15.\"	California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\"    may be used to endorse or promote products derived from this software
18.\"    without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\"	@(#)passwd.1	8.1 (Berkeley) 6/6/93
33.\" $FreeBSD$
34.\"
35.Dd June 6, 1993
36.Dt PASSWD 1
37.Os BSD 4
38.Sh NAME
39.Nm passwd, yppasswd
40.Nd modify a user's password
41.Sh SYNOPSIS
42.Nm passwd
43.Op Fl l
44.Op Ar user
45.Nm yppasswd
46.Op Fl l
47.Op Fl y
48.Op Fl d Ar domain
49.Op Fl h Ar host
50.Op Fl o
51.Sh DESCRIPTION
52.Nm Passwd
53changes the user's local, Kerberos, or NIS password.
54If the user is not the super-user,
55.Nm passwd
56first prompts for the current password and will not continue unless the correct
57password is entered.
58.Pp
59When entering the new password, the characters entered do not echo, in order to
60avoid the password being seen by a passer-by.
61.Nm passwd
62prompts for the new password twice in order to detect typing errors.
63.Pp
64The new password should be at least six characters long (which
65may be overridden using the
66.Xr login.conf 5
67.if t ``minpasswordlen''
68.if n "minpasswordlen"
69setting for a user's login class) and not purely alphabetic.
70Its total length must be less than
71.Dv _PASSWORD_LEN
72(currently 128 characters).
73.Pp
74The new password should contain a mixture of upper and lower case
75characters (which may be overridden using the
76.Xr login.conf 5
77.if t ``mixpasswordcase''
78.if n "mixpasswordcase"
79setting for a user's login class).  Allowing lower case passwords may
80be useful where the password file will be used in situations where only
81lower case passwords are permissable, such as when using Samba to
82authenticate Windows clients.  In all other situations, numbers, upper
83case letters and meta characters are encouraged.
84.Pp
85Once the password has been verified,
86.Nm passwd
87communicates the new password information to
88the Kerberos authenticating host.
89.Bl -tag -width flag
90.It Fl l
91This option causes the password to be updated only in the local
92password file, and not with the Kerberos database.
93When changing only the local password,
94.Xr pwd_mkdb  8
95is used to update the password databases.
96.Pp
97.El
98When changing local or NIS password, the next password change date
99is set according to
100.if t ``passwordtime''
101.if n "passwordtime"
102capability in the user's login class.
103.Pp
104To change another user's Kerberos password, one must first
105run
106.Xr kinit 1
107followed by
108.Xr passwd 1 .
109The super-user is not required to provide a user's current password
110if only the local password is modified.
111.Sh NIS INTERACTION
112.Nm Passwd
113has built-in support for NIS.
114If a user exists in the NIS password
115database but does not exist locally,
116.Nm passwd
117automatically switches into
118.if t ``yppasswd''
119.if n "yppasswd"
120mode.
121If the specified
122user does not exist in either the local password database of the
123NIS password maps,
124.Nm passwd
125returns an error.
126.Pp
127When changing an NIS password, unprivileged users are required to provide
128their old password for authentication (the
129.Xr rpc.yppasswdd 8
130daemon requires the original password before
131it will allow any changes to the NIS password maps).
132This restriction applies even to the
133super-user, with one important exception: the password authentication is
134bypassed for the super-user on the NIS master server.
135This means that
136the super-user on the NIS master server can make unrestricted changes to
137anyone's NIS password.
138The super-user on NIS client systems and NIS slave
139servers still needs to provide a password before the update will be processed.
140.Pp
141The following additional options are supported for use with NIS:
142.Bl -tag -width flag
143.It Fl y
144The
145.Fl y
146flag overrides
147.Nm passwd 's
148checking heuristics and forces
149it into NIS mode.
150.It Fl l
151When NIS is enabled, the
152.Fl l
153flag can be used to force
154.Nm passwd
155into
156.if t ``local only''
157.if n "local only"
158mode.
159This flag can be used to change the entry
160for a local user when an NIS user exists with the same login name.
161For example, you will sometimes find entries for system
162.if t ``placeholder''
163.if n "placeholder"
164users such as
165.Pa bin
166or
167.Pa daemon
168in both the NIS password maps and the local user database.
169By
170default,
171.Nm passwd
172will try to change the NIS password.
173The
174.Fl l
175flag can be used to change the local password instead.
176.It Fl d Ar domain
177Specify what domain to use when changing an NIS password.
178By default,
179.Nm passwd
180assumes that the system default domain should be used.
181This flag is
182primarily for use by the superuser on the NIS master server: a single
183NIS server can support multiple domains.
184It is also possible that the
185domainname on the NIS master may not be set (it is not necessary for
186an NIS server to also be a client) in which case the
187.Nm passwd
188command needs to be told what domain to operate on.
189.It Fl s Ar host
190Specify the name of an NIS server.
191This option, in conjunction
192with the
193.Fl d
194option, can be used to change an NIS password on a non-local NIS
195server.
196When a domain is specified with the
197.Fl d
198option and
199.Nm passwd
200is unable to determine the name of the NIS master server (possibly because
201the local domainname isn't set), the name of the NIS master is assumed to
202be
203.if t ``localhost''.
204.if n "localhost".
205This can be overidden with the
206.Fl s
207flag.
208The specified hostname need not be the name of an NIS master: the
209name of the NIS master for a given map can be determined by querying any
210NIS server (master or slave) in a domain, so specifying the name of a
211slave server will work equally well.
212.Pp
213.It Fl o
214Do not automatically override the password authentication checks for the
215super-user on the NIS master server; assume 'old' mode instead.
216This
217flag is of limited practical use but is useful for testing.
218.El
219.Sh FILES
220.Bl -tag -width /etc/master.passwd -compact
221.It Pa /etc/master.passwd
222The user database
223.It Pa /etc/passwd
224A Version 7 format password file
225.It Pa /etc/passwd.XXXXXX
226Temporary copy of the password file
227.It Pa /etc/login.conf
228Login class capabilities database
229.It Pa /etc/auth.conf
230configure authentication services
231.El
232.Sh SEE ALSO
233.Xr chpass 1 ,
234.Xr kerberos 1 ,
235.Xr kinit 1 ,
236.Xr login 1 ,
237.Xr login.conf 5 ,
238.Xr passwd 5 ,
239.Xr kpasswdd 8 ,
240.Xr pwd_mkdb 8 ,
241.Xr vipw 8
242.Rs
243.%A Robert Morris
244.%A Ken Thompson
245.%T "UNIX password security"
246.Re
247.Sh NOTES
248The
249.Xr yppasswd 1
250command is really only a link to
251.Nm passwd .
252.Sh HISTORY
253A
254.Nm passwd
255command appeared in
256.At v6 .
257