xref: /freebsd/usr.bin/passwd/passwd.1 (revision ee2ea5ceafed78a5bd9810beb9e3ca927180c226)
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
38.Sh NAME
39.Nm passwd , yppasswd
40.Nd modify a user's password
41.Sh SYNOPSIS
42.Nm
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
52The
53.Nm
54utility changes the user's local, Kerberos, or NIS password.
55If the user is not the super-user,
56.Nm
57first prompts for the current password and will not continue unless the correct
58password is entered.
59.Pp
60When entering the new password, the characters entered do not echo, in order to
61avoid the password being seen by a passer-by.
62The
63.Nm
64utility prompts for the new password twice in order to detect typing errors.
65.Pp
66The new password should be at least six characters long (which
67may be overridden using the
68.Xr login.conf 5
69.Dq minpasswordlen
70setting for a user's login class) and not purely alphabetic.
71Its total length must be less than
72.Dv _PASSWORD_LEN
73(currently 128 characters).
74.Pp
75The new password should contain a mixture of upper and lower case
76characters (which may be overridden using the
77.Xr login.conf 5
78.Dq 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 permissible, 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
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.Dq passwordtime
101capability in the user's login class.
102.Pp
103To change another user's Kerberos password, one must first
104run
105.Xr kinit 1
106followed by
107.Xr passwd 1 .
108The super-user is not required to provide a user's current password
109if only the local password is modified.
110.Sh NIS INTERACTION
111The
112.Nm
113utility has built-in support for NIS.
114If a user exists in the NIS password
115database but does not exist locally,
116.Nm
117automatically switches into
118.Dq yppasswd
119mode.
120If the specified
121user does not exist in either the local password database of the
122NIS password maps,
123.Nm
124returns an error.
125.Pp
126When changing an NIS password, unprivileged users are required to provide
127their old password for authentication (the
128.Xr rpc.yppasswdd 8
129daemon requires the original password before
130it will allow any changes to the NIS password maps).
131This restriction applies even to the
132super-user, with one important exception: the password authentication is
133bypassed for the super-user on the NIS master server.
134This means that
135the super-user on the NIS master server can make unrestricted changes to
136anyone's NIS password.
137The super-user on NIS client systems and NIS slave
138servers still needs to provide a password before the update will be processed.
139.Pp
140The following additional options are supported for use with NIS:
141.Bl -tag -width flag
142.It Fl y
143The
144.Fl y
145flag overrides
146.Nm Ns 's
147checking heuristics and forces
148it into NIS mode.
149.It Fl l
150When NIS is enabled, the
151.Fl l
152flag can be used to force
153.Nm
154into
155.Dq local only
156mode.
157This flag can be used to change the entry
158for a local user when an NIS user exists with the same login name.
159For example, you will sometimes find entries for system
160.Dq placeholder
161users such as
162.Pa bin
163or
164.Pa daemon
165in both the NIS password maps and the local user database.
166By
167default,
168.Nm
169will try to change the NIS password.
170The
171.Fl l
172flag can be used to change the local password instead.
173.It Fl d Ar domain
174Specify what domain to use when changing an NIS password.
175By default,
176.Nm
177assumes that the system default domain should be used.
178This flag is
179primarily for use by the superuser on the NIS master server: a single
180NIS server can support multiple domains.
181It is also possible that the
182domainname on the NIS master may not be set (it is not necessary for
183an NIS server to also be a client) in which case the
184.Nm
185command needs to be told what domain to operate on.
186.It Fl h Ar host
187Specify the name of an NIS server.
188This option, in conjunction
189with the
190.Fl d
191option, can be used to change an NIS password on a non-local NIS
192server.
193When a domain is specified with the
194.Fl d
195option and
196.Nm
197is unable to determine the name of the NIS master server (possibly because
198the local domainname isn't set), the name of the NIS master is assumed to
199be
200.Dq localhost .
201This can be overridden with the
202.Fl h
203flag.
204The specified hostname need not be the name of an NIS master: the
205name of the NIS master for a given map can be determined by querying any
206NIS server (master or slave) in a domain, so specifying the name of a
207slave server will work equally well.
208.Pp
209.It Fl o
210Do not automatically override the password authentication checks for the
211super-user on the NIS master server; assume 'old' mode instead.
212This
213flag is of limited practical use but is useful for testing.
214.El
215.Sh FILES
216.Bl -tag -width /etc/master.passwd -compact
217.It Pa /etc/master.passwd
218The user database
219.It Pa /etc/passwd
220A Version 7 format password file
221.It Pa /etc/passwd.XXXXXX
222Temporary copy of the password file
223.It Pa /etc/login.conf
224Login class capabilities database
225.It Pa /etc/auth.conf
226configure authentication services
227.El
228.Sh SEE ALSO
229.Xr chpass 1 ,
230.Xr kerberos 1 ,
231.Xr kinit 1 ,
232.Xr login 1 ,
233.Xr login.conf 5 ,
234.Xr passwd 5 ,
235.Xr kpasswdd 8 ,
236.Xr pwd_mkdb 8 ,
237.Xr vipw 8
238.Rs
239.%A Robert Morris
240.%A Ken Thompson
241.%T "UNIX password security"
242.Re
243.Sh NOTES
244The
245.Xr yppasswd 1
246command is really only a link to
247.Nm .
248.Sh HISTORY
249A
250.Nm
251command appeared in
252.At v6 .
253