xref: /freebsd/usr.bin/passwd/passwd.1 (revision aa0a1e58)
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.\" 4. 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$
30.\"
31.Dd June 6, 1993
32.Dt PASSWD 1
33.Os
34.Sh NAME
35.Nm passwd , yppasswd
36.Nd modify a user's password
37.Sh SYNOPSIS
38.Nm
39.Op Fl l
40.Op Ar user
41.Nm yppasswd
42.Op Fl l
43.Op Fl y
44.Op Fl d Ar domain
45.Op Fl h Ar host
46.Op Fl o
47.Sh DESCRIPTION
48The
49.Nm
50utility changes the user's local, Kerberos, or NIS password.
51If the user is not the super-user,
52.Nm
53first prompts for the current password and will not continue unless the correct
54password is entered.
55.Pp
56When entering the new password, the characters entered do not echo, in order to
57avoid the password being seen by a passer-by.
58The
59.Nm
60utility prompts for the new password twice in order to detect typing errors.
61.Pp
62The new password should be at least six characters long (which
63may be overridden using the
64.Xr login.conf 5
65.Dq minpasswordlen
66setting for a user's login class) and not purely alphabetic.
67Its total length must be less than
68.Dv _PASSWORD_LEN
69(currently 128 characters).
70.Pp
71The new password should contain a mixture of upper and lower case
72characters (which may be overridden using the
73.Xr login.conf 5
74.Dq mixpasswordcase
75setting for a user's login class).
76Allowing lower case passwords may
77be useful where the password file will be used in situations where only
78lower case passwords are permissible, such as when using Samba to
79authenticate Windows clients.
80In all other situations, numbers, upper
81case letters and meta characters are encouraged.
82.Pp
83Once the password has been verified,
84.Nm
85communicates the new password information to
86the Kerberos authenticating host.
87.Pp
88The following option is available:
89.Bl -tag -width indent
90.It Fl l
91Cause 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.El
97.Pp
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.Nm .
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.Nm yppasswd
119mode.
120If the specified
121user does not exist in either the local password database or 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 indent
142.It Fl y
143Override
144.Nm Ns 's
145checking heuristics and forces
146it into NIS mode.
147.It Fl l
148When NIS is enabled, the
149.Fl l
150flag can be used to force
151.Nm
152into
153.Dq local only
154mode.
155This flag can be used to change the entry
156for a local user when an NIS user exists with the same login name.
157For example, you will sometimes find entries for system
158.Dq placeholder
159users such as
160.Pa bin
161or
162.Pa daemon
163in both the NIS password maps and the local user database.
164By
165default,
166.Nm
167will try to change the NIS password.
168The
169.Fl l
170flag can be used to change the local password instead.
171.It Fl d Ar domain
172Specify what domain to use when changing an NIS password.
173By default,
174.Nm
175assumes that the system default domain should be used.
176This flag is
177primarily for use by the superuser on the NIS master server: a single
178NIS server can support multiple domains.
179It is also possible that the
180domainname on the NIS master may not be set (it is not necessary for
181an NIS server to also be a client) in which case the
182.Nm
183command needs to be told what domain to operate on.
184.It Fl h Ar host
185Specify the name of an NIS server.
186This option, in conjunction
187with the
188.Fl d
189option, can be used to change an NIS password on a non-local NIS
190server.
191When a domain is specified with the
192.Fl d
193option and
194.Nm
195is unable to determine the name of the NIS master server (possibly because
196the local domainname is not set), the name of the NIS master is assumed to
197be
198.Dq localhost .
199This can be overridden with the
200.Fl h
201flag.
202The specified hostname need not be the name of an NIS master: the
203name of the NIS master for a given map can be determined by querying any
204NIS server (master or slave) in a domain, so specifying the name of a
205slave server will work equally well.
206.It Fl o
207Do not automatically override the password authentication checks for the
208super-user on the NIS master server; assume
209.Dq old
210mode instead.
211This
212flag is of limited practical use but is useful for testing.
213.El
214.Sh FILES
215.Bl -tag -width /etc/master.passwd -compact
216.It Pa /etc/master.passwd
217the user database
218.It Pa /etc/passwd
219a Version 7 format password file
220.It Pa /etc/passwd.XXXXXX
221temporary copy of the password file
222.It Pa /etc/login.conf
223login class capabilities database
224.It Pa /etc/auth.conf
225configure authentication services
226.El
227.Sh SEE ALSO
228.Xr chpass 1 ,
229.Xr kinit 1 ,
230.Xr login 1 ,
231.Xr login.conf 5 ,
232.Xr passwd 5 ,
233.Xr kerberos 8 ,
234.Xr kpasswdd 8 ,
235.Xr pw 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.Nm yppasswd
246command is really only a link to
247.Nm .
248.Sh HISTORY
249A
250.Nm
251command appeared in
252.At v6 .
253