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.\" $Id: passwd.1,v 1.9 1998/08/24 00:56:20 steve Exp $ 34.\" 35.Dd June 6, 1993 36.Dt PASSWD 1 37.Os BSD 4 38.Sh NAME 39.Nm passwd, yppasswd 40.Nd modify a user's password 41.Sh SYNOPSIS 42.Nm passwd 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 52.Nm Passwd 53changes the user's local, Kerberos, or NIS password. First, the user is prompted for their 54current password. 55If the current password is correctly typed, a new password is 56requested. 57The new password must be entered twice to avoid typing errors. 58.Pp 59The new password should be at least six characters long (which 60may be overridden using the 61.Xr login.cap 5 62"minpasswordlen" setting for a user's login class) and not purely alphabetic. 63Its total length must be less than 64.Dv _PASSWORD_LEN 65(currently 128 characters). 66Numbers, upper case letters and meta characters 67are encouraged. 68.Pp 69Once the password has been verified, 70.Nm passwd 71communicates the new password information to 72the Kerberos authenticating host. 73.Bl -tag -width flag 74.It Fl l 75This option causes the password to be updated only in the local 76password file, and not with the Kerberos database. 77When changing only the local password, 78.Xr pwd_mkdb 8 79is used to update the password databases. 80.Pp 81.El 82When changing local or NIS password, the next password change date 83is set according to "passwordperiod" capability in the user's 84login class. 85.Pp 86To change another user's Kerberos password, one must first 87run 88.Xr kinit 1 89followed by 90.Xr passwd 1 . 91The super-user is not required to provide a user's current password 92if only the local password is modified. 93.Sh NIS INTERACTION 94.Nm Passwd 95has built-in support for NIS. If a user exists in the NIS password 96database but does not exist locally, 97.Nm passwd 98automatically switches into ``yppasswd'' mode. If the specified 99user does not exist in either the local password database of the 100NIS password maps, 101.Nm passwd 102returns an error. 103.Pp 104When changing an NIS password, unprivileged users are required to provide 105their old password for authentication (the 106.Xr rpc.yppasswdd 8 107daemon requires the original password before 108it will allow any changes to the NIS password maps). 109This restriction applies even to the 110super-user, with one important exception: the password authentication is 111bypassed for the super-user on the NIS master server. This means that 112the super-user on the NIS master server can make unrestricted changes to 113anyone's NIS password. The super-user on NIS client systems and NIS slave 114servers still needs to provide a password before the update will be processed. 115.Pp 116The following additional options are supported for use with NIS: 117.Bl -tag -width flag 118.It Fl y 119The 120.Fl y 121flag overrides 122.Nm passwd 's 123checking heuristics and forces 124it into NIS mode. 125.It Fl l 126When NIS is enabled, the 127.Fl l 128flag can be used to force 129.Nm passwd 130into ``local only'' mode. This flag can be used to change the entry 131for a local user when an NIS user exists with the same login name. 132For example, you will sometimes find entries for system ``placeholder'' 133users such as 134.Pa bin 135or 136.Pa daemon 137in both the NIS password maps and the local user database. By 138default, 139.Nm passwd 140will try to change the NIS password. The 141.Fl l 142flag can be used to change the local password instead. 143.It Fl d Ar domain 144Specify what domain to use when changing an NIS password. By default, 145.Nm passwd 146assumes that the system default domain should be used. This flag is 147primarily for use by the superuser on the NIS master server: a single 148NIS server can support multiple domains. It is also possible that the 149domainname on the NIS master may not be set (it is not necessary for 150an NIS server to also be a client) in which case the 151.Nm passwd 152command needs to be told what domain to operate on. 153.It Fl s Ar host 154Specify the name of an NIS server. This option, in conjunction 155with the 156.Fl d 157option, can be used to change an NIS password on a non-local NIS 158server. When a domain is specified with the 159.Fl d 160option and 161.Nm passwd 162is unable to determine the name of the NIS master server (possibly because 163the local domainname isn't set), the name of the NIS master is assumed to 164be ``localhost''. This can be overidden with the 165.Fl s 166flag. The specified hostname need not be the name of an NIS master: the 167name of the NIS master for a given map can be determined by querying any 168NIS server (master or slave) in a domain, so specifying the name of a 169slave server will work equally well. 170.Pp 171.It Fl o 172Do not automatically override the password authentication checks for the 173super-user on the NIS master server; assume 'old' mode instead. This 174flag is of limited practical use but is useful for testing. 175.El 176.Sh FILES 177.Bl -tag -width /etc/master.passwd -compact 178.It Pa /etc/master.passwd 179The user database 180.It Pa /etc/passwd 181A Version 7 format password file 182.It Pa /etc/passwd.XXXXXX 183Temporary copy of the password file 184.It Pa /etc/login.conf 185Login class capabilities database 186.It Pa /etc/auth.conf 187configure authentication services 188.El 189.Sh SEE ALSO 190.Xr chpass 1 , 191.Xr kerberos 1 , 192.Xr kinit 1 , 193.Xr login 1 , 194.Xr login.conf 5 , 195.Xr passwd 5 , 196.Xr kpasswdd 8 , 197.Xr pwd_mkdb 8 , 198.Xr vipw 8 199.Rs 200.%A Robert Morris 201.%A Ken Thompson 202.%T "UNIX password security" 203.Re 204.Sh NOTES 205The 206.Xr yppasswd 1 207command is really only a link to 208.Nm passwd . 209.Sh HISTORY 210A 211.Nm passwd 212command appeared in 213.At v6 . 214