xref: /dragonfly/usr.bin/passwd/passwd.1 (revision f746689a)
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: src/usr.bin/passwd/passwd.1,v 1.33 2007/11/07 07:59:38 ru Exp $
34.\" $DragonFly: src/usr.bin/passwd/passwd.1,v 1.6 2006/11/17 23:23:05 swildner Exp $
35.\"
36.Dd June 6, 1993
37.Dt PASSWD 1
38.Os
39.Sh NAME
40.Nm passwd ,
41.Nm yppasswd
42.Nd modify a user's password
43.Sh SYNOPSIS
44.Nm
45.Op Fl l
46.Op Ar user
47.Nm yppasswd
48.Op Fl l
49.Op Fl y
50.Op Fl d Ar domain
51.Op Fl h Ar host
52.Op Fl o
53.Sh DESCRIPTION
54The
55.Nm
56utility changes the user's local, Kerberos, or NIS password.
57If the user is not the super-user,
58.Nm
59first prompts for the current password and will not continue unless the correct
60password is entered.
61.Pp
62When entering the new password, the characters entered do not echo, in order to
63avoid the password being seen by a passer-by.
64The
65.Nm
66utility prompts for the new password twice in order to detect typing errors.
67.Pp
68The new password should be at least six characters long (which
69may be overridden using the
70.Xr login.conf 5
71.Dq minpasswordlen
72setting for a user's login class) and not purely alphabetic.
73Its total length must be less than
74.Dv _PASSWORD_LEN
75(currently 128 characters).
76.Pp
77The new password should contain a mixture of upper and lower case
78characters (which may be overridden using the
79.Xr login.conf 5
80.Dq mixpasswordcase
81setting for a user's login class).
82Allowing lower case passwords may
83be useful where the password file will be used in situations where only
84lower case passwords are permissible, such as when using Samba to
85authenticate Windows clients.
86In all other situations, numbers, upper
87case letters and meta characters are encouraged.
88.Pp
89Once the password has been verified,
90.Nm
91communicates the new password information to
92the Kerberos authenticating host.
93.Pp
94The following option is available:
95.Bl -tag -width indent
96.It Fl l
97Cause the password to be updated only in the local
98password file, and not with the Kerberos database.
99When changing only the local password,
100.Xr pwd_mkdb 8
101is used to update the password databases.
102.El
103.Pp
104When changing local or NIS password, the next password change date
105is set according to
106.Dq passwordtime
107capability in the user's login class.
108.Pp
109To change another user's Kerberos password, one must first
110run
111.Xr kinit 1
112followed by
113.Nm .
114The super-user is not required to provide a user's current password
115if only the local password is modified.
116.Sh NIS INTERACTION
117The
118.Nm
119utility has built-in support for NIS.
120If a user exists in the NIS password
121database but does not exist locally,
122.Nm
123automatically switches into
124.Nm yppasswd
125mode.
126If the specified
127user does not exist in either the local password database or the
128NIS password maps,
129.Nm
130returns an error.
131.Pp
132When changing an NIS password, unprivileged users are required to provide
133their old password for authentication (the
134.Xr rpc.yppasswdd 8
135daemon requires the original password before
136it will allow any changes to the NIS password maps).
137This restriction applies even to the
138super-user, with one important exception: the password authentication is
139bypassed for the super-user on the NIS master server.
140This means that
141the super-user on the NIS master server can make unrestricted changes to
142anyone's NIS password.
143The super-user on NIS client systems and NIS slave
144servers still needs to provide a password before the update will be processed.
145.Pp
146The following additional options are supported for use with NIS:
147.Bl -tag -width indent
148.It Fl y
149Override
150.Nm Ns 's
151checking heuristics and forces
152it into NIS mode.
153.It Fl l
154When NIS is enabled, the
155.Fl l
156flag can be used to force
157.Nm
158into
159.Dq local only
160mode.
161This flag can be used to change the entry
162for a local user when an NIS user exists with the same login name.
163For example, you will sometimes find entries for system
164.Dq placeholder
165users such as
166.Pa bin
167or
168.Pa daemon
169in both the NIS password maps and the local user database.
170By
171default,
172.Nm
173will try to change the NIS password.
174The
175.Fl l
176flag can be used to change the local password instead.
177.It Fl d Ar domain
178Specify what domain to use when changing an NIS password.
179By default,
180.Nm
181assumes that the system default domain should be used.
182This flag is
183primarily for use by the superuser on the NIS master server: a single
184NIS server can support multiple domains.
185It is also possible that the
186domainname on the NIS master may not be set (it is not necessary for
187an NIS server to also be a client) in which case the
188.Nm
189command needs to be told what domain to operate on.
190.It Fl h Ar host
191Specify the name of an NIS server.
192This option, in conjunction
193with the
194.Fl d
195option, can be used to change an NIS password on a non-local NIS
196server.
197When a domain is specified with the
198.Fl d
199option and
200.Nm
201is unable to determine the name of the NIS master server (possibly because
202the local domainname is not set), the name of the NIS master is assumed to
203be
204.Dq localhost .
205This can be overridden with the
206.Fl h
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.It Fl o
213Do not automatically override the password authentication checks for the
214super-user on the NIS master server; assume
215.Dq old
216mode instead.
217This
218flag is of limited practical use but is useful for testing.
219.El
220.Sh FILES
221.Bl -tag -width /etc/master.passwd -compact
222.It Pa /etc/master.passwd
223the user database
224.It Pa /etc/passwd
225a Version 7 format password file
226.It Pa /etc/passwd.XXXXXX
227temporary copy of the password file
228.It Pa /etc/login.conf
229login class capabilities database
230.It Pa /etc/auth.conf
231configure authentication services
232.El
233.Sh SEE ALSO
234.Xr chpass 1 ,
235.Xr kinit 1 ,
236.Xr login 1 ,
237.Xr login.conf 5 ,
238.Xr passwd 5 ,
239.Xr kerberos 8 ,
240.Xr kpasswdd 8 ,
241.Xr pw 8 ,
242.Xr pwd_mkdb 8 ,
243.Xr vipw 8
244.Rs
245.%A Robert Morris
246.%A Ken Thompson
247.%T "UNIX password security"
248.Re
249.Sh NOTES
250The
251.Nm yppasswd
252command is really only a link to
253.Nm .
254.Sh HISTORY
255A
256.Nm
257command appeared in
258.At v6 .
259