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