xref: /dragonfly/usr.bin/passwd/passwd.1 (revision cd1c6085)
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. Neither the name of the University nor the names of its contributors
13.\"    may be used to endorse or promote products derived from this software
14.\"    without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\"	@(#)passwd.1	8.1 (Berkeley) 6/6/93
29.\" $FreeBSD: src/usr.bin/passwd/passwd.1,v 1.33 2007/11/07 07:59:38 ru Exp $
30.\" $DragonFly: src/usr.bin/passwd/passwd.1,v 1.6 2006/11/17 23:23:05 swildner Exp $
31.\"
32.Dd June 6, 1993
33.Dt PASSWD 1
34.Os
35.Sh NAME
36.Nm passwd ,
37.Nm yppasswd
38.Nd modify a user's password
39.Sh SYNOPSIS
40.Nm
41.Op Fl l
42.Op Ar user
43.Nm yppasswd
44.Op Fl l
45.Op Fl y
46.Op Fl d Ar domain
47.Op Fl h Ar host
48.Op Fl o
49.Sh DESCRIPTION
50The
51.Nm
52utility changes the user's local, Kerberos, or NIS password.
53If the user is not the super-user,
54.Nm
55first prompts for the current password and will not continue unless the correct
56password is entered.
57.Pp
58When entering the new password, the characters entered do not echo, in order to
59avoid the password being seen by a passer-by.
60The
61.Nm
62utility prompts 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.Dq minpasswordlen
68setting for a user's login class) and not purely alphabetic.
69Its total length must be less than
70.Dv _PASSWORD_LEN
71(currently 128 characters).
72.Pp
73The new password should contain a mixture of upper and lower case
74characters (which may be overridden using the
75.Xr login.conf 5
76.Dq mixpasswordcase
77setting for a user's login class).
78Allowing lower case passwords may
79be useful where the password file will be used in situations where only
80lower case passwords are permissible, such as when using Samba to
81authenticate Windows clients.
82In 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.Pp
90The following option is available:
91.Bl -tag -width indent
92.It Fl l
93Cause the password to be updated only in the local
94password file, and not with the Kerberos database.
95When changing only the local password,
96.Xr pwd_mkdb 8
97is used to update the password databases.
98.El
99.Pp
100When changing local or NIS password, the next password change date
101is set according to
102.Dq passwordtime
103capability in the user's login class.
104.Pp
105To change another user's Kerberos password, one must first
106run
107.Xr kinit 1
108followed by
109.Nm .
110The super-user is not required to provide a user's current password
111if only the local password is modified.
112.Sh NIS INTERACTION
113The
114.Nm
115utility has built-in support for NIS.
116If a user exists in the NIS password
117database but does not exist locally,
118.Nm
119automatically switches into
120.Nm yppasswd
121mode.
122If the specified
123user does not exist in either the local password database or the
124NIS password maps,
125.Nm
126returns an error.
127.Pp
128When changing an NIS password, unprivileged users are required to provide
129their old password for authentication (the
130.Xr rpc.yppasswdd 8
131daemon requires the original password before
132it will allow any changes to the NIS password maps).
133This restriction applies even to the
134super-user, with one important exception: the password authentication is
135bypassed for the super-user on the NIS master server.
136This means that
137the super-user on the NIS master server can make unrestricted changes to
138anyone's NIS password.
139The super-user on NIS client systems and NIS slave
140servers still needs to provide a password before the update will be processed.
141.Pp
142The following additional options are supported for use with NIS:
143.Bl -tag -width indent
144.It Fl y
145Override
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 is not 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.It Fl o
209Do not automatically override the password authentication checks for the
210super-user on the NIS master server; assume
211.Dq old
212mode instead.
213This
214flag is of limited practical use but is useful for testing.
215.El
216.Sh FILES
217.Bl -tag -width /etc/master.passwd -compact
218.It Pa /etc/master.passwd
219the user database
220.It Pa /etc/passwd
221a Version 7 format password file
222.It Pa /etc/passwd.XXXXXX
223temporary copy of the password file
224.It Pa /etc/login.conf
225login class capabilities database
226.It Pa /etc/auth.conf
227configure authentication services
228.El
229.Sh SEE ALSO
230.Xr chpass 1 ,
231.Xr kinit 1 ,
232.Xr login 1 ,
233.Xr login.conf 5 ,
234.Xr passwd 5 ,
235.Xr kerberos 8 ,
236.Xr kpasswdd 8 ,
237.Xr pw 8 ,
238.Xr pwd_mkdb 8 ,
239.Xr vipw 8
240.Rs
241.%A Robert Morris
242.%A Ken Thompson
243.%T "UNIX password security"
244.Re
245.Sh NOTES
246The
247.Nm yppasswd
248command is really only a link to
249.Nm .
250.Sh HISTORY
251A
252.Nm
253command appeared in
254.At v6 .
255