xref: /netbsd-src/usr.bin/passwd/passwd.1 (revision 9fbd88883c38d0c0fbfcbe66d76fe6b0fab3f9de)
1.\"	$NetBSD: passwd.1,v 1.18 2001/12/01 16:43:22 wiz Exp $
2.\"
3.\" Copyright (c) 1990, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software
15.\"    must display the following acknowledgement:
16.\"	This product includes software developed by the University of
17.\"	California, Berkeley and its contributors.
18.\" 4. Neither the name of the University nor the names of its contributors
19.\"    may be used to endorse or promote products derived from this software
20.\"    without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\"	from: @(#)passwd.1    8.1 (Berkeley) 6/6/93
35.\"
36.Dd June 6, 1993
37.Dt PASSWD 1
38.Os
39.Sh NAME
40.Nm passwd ,
41.Nm yppasswd ,
42.Nm kpasswd
43.Nd modify a user's password
44.Sh SYNOPSIS
45.Nm passwd
46.Op Fl l
47.Op Ar user
48.Nm passwd
49.Op Fl y
50.Op Ar user
51.Nm passwd
52.Op Fl 4
53.Op Fl k
54.Op Fl i Ar instance
55.Op Fl r Ar realm
56.Op Fl u Ar fullname
57.Op Ar user
58.Nm passwd
59.Op Fl 5
60.Op Fl k
61.Op Fl u Ar fullname
62.Op Ar user
63.Nm kpasswd
64.Op Fl 4
65.Op Fl k
66.Op Fl i Ar instance
67.Op Fl r Ar realm
68.Op Fl u Ar fullname
69.Op Ar user
70.Nm kpasswd
71.Op Fl 5
72.Op Fl k
73.Op Fl u Ar fullname
74.Op Ar user
75.Nm yppasswd
76.Op Ar user
77.Sh DESCRIPTION
78.Nm
79changes the user's local, YP, or kerberos password.  First, the user is
80prompted for their current password.
81If the current password is correctly typed, a new password is
82requested.
83The new password must be entered twice to avoid typing errors.
84.Pp
85The new password should be at least six characters long and not
86purely alphabetic.
87Its total length must be less than
88.Dv _PASSWORD_LEN
89(currently 128 characters).
90Numbers, upper case letters and meta characters
91are encouraged.
92.Pp
93All options may not be available on all systems.
94.Bl -tag -width flag
95.It Fl l
96This option causes the password to be updated only in the local
97password file.  When changing only the local password,
98.Xr pwd_mkdb  8
99is used to update the password databases.
100.It Fl y
101This forces the YP password database entry to be changed, even if
102the user has an entry in the local database.  The
103.Xr rpc.yppasswdd 8
104daemon should be running on the YP master server.
105.Nm yppasswd
106is the equivalent of
107.Nm
108with the
109.Fl y
110flag.
111.It Fl 4
112This option causes passwd to change the user's kerberos password,
113using the kerberos 4 admin protocol.
114.It Fl 5
115This option causes passwd to change the user's kerberos password,
116using the kerberos 5 admin protocol.
117.It Fl k
118This option causes passwd to change the user's kerberos password,
119using either the kerberos 4 or kerberos 5 admin protocol.
120If both kerberos 4 and kerberos 5 libraries and config files are
121installed on the host, kerberos 5 will be used to change the password.
122.Nm kpasswd
123is the equivalent of
124.Nm
125with the
126.Fl k
127flag.
128.It Fl i Ar instance
129This option selects a non-default Kerberos 4 instance for the
130Kerberos password to be changed.
131.It Fl r Ar realm
132This option selects a non-default Kerberos 4 realm for the Kerberos
133password to be changed.
134.It Fl u Ar fullname
135This option specifies the entire principal.instance@realm (for Kerberos
1364) or principal/instance@realm (for Kerberos 5) for the Kerberos
137password to be changed.
138.El
139.Pp
140This is the behavior if no flags are specified:
141If Kerberos is active then
142.Nm
143will talk to the Kerberos server, attempting to use Kerberos 5, then
144Kerberos 4 protocols to change the password (even if the user has an
145entry in the local database.)
146If Kerberos is unavailable, an attempt is made to use the YP database.
147If the password is not in the YP database, then
148an attempt is made to use the local password database.
149.Pp
150The super-user is not required to provide a user's current password
151if only the local password is modified.
152.Pp
153The type of cipher used to encrypt the password depends on the configuration
154in
155.Xr passwd.conf 5 .
156It can be different for local and YP passwords.
157.Sh FILES
158.Bl -tag -width /etc/master.passwd -compact
159.It Pa /etc/master.passwd
160The user database
161.It Pa /etc/passwd
162A Version 7 format password file
163.It Pa /etc/passwd.XXXXXX
164Temporary copy of the password file
165.El
166.Sh SEE ALSO
167.Xr chpass 1 ,
168.Xr login 1 ,
169.Xr passwd 5 ,
170.Xr passwd.conf 5 ,
171.Xr pwd_mkdb 8 ,
172.Xr vipw 8
173.Rs
174.%A Robert Morris
175.%A Ken Thompson
176.%T "UNIX password security"
177.Re
178.Sh HISTORY
179A
180.Nm
181command appeared in
182.At v6 .
183