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