[BACK]Return to chpass.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / chpass

Annotation of src/usr.bin/chpass/chpass.1, Revision 1.38

1.38    ! jmc         1: .\"    $OpenBSD: chpass.1,v 1.37 2012/06/20 21:32:27 schwarze Exp $
1.2       deraadt     2: .\"    $NetBSD: chpass.1,v 1.7 1996/05/15 21:50:40 jtc Exp $
1.1       deraadt     3: .\"
                      4: .\" Copyright (c) 1988, 1990, 1993
                      5: .\"    The Regents of the University of California.  All rights reserved.
                      6: .\"
                      7: .\" Redistribution and use in source and binary forms, with or without
                      8: .\" modification, are permitted provided that the following conditions
                      9: .\" are met:
                     10: .\" 1. Redistributions of source code must retain the above copyright
                     11: .\"    notice, this list of conditions and the following disclaimer.
                     12: .\" 2. Redistributions in binary form must reproduce the above copyright
                     13: .\"    notice, this list of conditions and the following disclaimer in the
                     14: .\"    documentation and/or other materials provided with the distribution.
1.28      millert    15: .\" 3. Neither the name of the University nor the names of its contributors
1.1       deraadt    16: .\"    may be used to endorse or promote products derived from this software
                     17: .\"    without specific prior written permission.
                     18: .\"
                     19: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     20: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     21: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     22: .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     23: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     24: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     25: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     26: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     27: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     28: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     29: .\" SUCH DAMAGE.
                     30: .\"
                     31: .\"     @(#)chpass.1   8.2 (Berkeley) 12/30/93
                     32: .\"
1.38    ! jmc        33: .Dd $Mdocdate: June 20 2012 $
1.1       deraadt    34: .Dt CHPASS 1
                     35: .Os
                     36: .Sh NAME
1.16      aaron      37: .Nm chpass ,
                     38: .Nm chfn ,
                     39: .Nm chsh
1.1       deraadt    40: .Nd add or change user database information
                     41: .Sh SYNOPSIS
                     42: .Nm chpass
1.13      niklas     43: .Op Fl ly
1.1       deraadt    44: .Op Fl s Ar newshell
1.9       aaron      45: .Op Ar user
1.33      jmc        46: .Nm chpass
                     47: .Op Fl l
                     48: .Fl a Ar list
1.1       deraadt    49: .Sh DESCRIPTION
1.16      aaron      50: .Nm chpass
1.1       deraadt    51: allows editing of the user database information associated
                     52: with
1.9       aaron      53: .Ar user ,
1.1       deraadt    54: or, by default, the current user.
                     55: The information is formatted and supplied to an editor for changes.
                     56: .Pp
                     57: Only the information that the user is allowed to change is displayed.
                     58: .Pp
1.24      millert    59: If YP is enabled change requests are first tried in the local database,
1.13      niklas     60: and then in the YP database, if there was no entry to change locally.
1.16      aaron      61: .Pp
                     62: .Nm chfn
                     63: and
                     64: .Nm chsh
                     65: are synonyms for
                     66: .Nm chpass .
1.13      niklas     67: .Pp
1.1       deraadt    68: The options are as follows:
                     69: .Bl -tag -width Ds
1.6       deraadt    70: .It Fl a Ar list
1.18      aaron      71: The superuser is allowed to directly supply a user database
1.1       deraadt    72: entry, in the format specified by
                     73: .Xr passwd 5 ,
                     74: as an argument.
1.9       aaron      75: This argument must be a colon
                     76: .Pq Sq \&:
                     77: separated list of all the
1.1       deraadt    78: user database fields, although they may be empty.
1.19      aaron      79: This operation is not supported in YP environments; only local additions
                     80: can be performed which requires the
1.13      niklas     81: .Fl l
1.19      aaron      82: flag to be specified.
1.13      niklas     83: .It Fl l
                     84: In environments where YP is enabled, always alter local information as
                     85: opposed to information in YP.
1.6       deraadt    86: .It Fl s Ar newshell
1.9       aaron      87: Attempts to change the user's shell to
1.1       deraadt    88: .Ar newshell .
1.13      niklas     89: .It Fl y
                     90: In environments where YP is enabled, always change the YP entry, even if this
                     91: is a modification request and there is a local entry for the specified user.
1.1       deraadt    92: .El
                     93: .Pp
                     94: Possible display items are as follows:
                     95: .Pp
1.14      aaron      96: .Bl -tag -width "Office Location:" -compact -offset indent
1.1       deraadt    97: .It Login:
                     98: user's login name
                     99: .It Password:
                    100: user's encrypted password
                    101: .It Uid:
                    102: user's login
                    103: .It Gid:
                    104: user's login group
                    105: .It Change:
                    106: password change time
                    107: .It Expire:
                    108: account expiration time
                    109: .It Class:
                    110: user's general classification
                    111: .It Home Directory:
                    112: user's home directory
                    113: .It Shell:
                    114: user's login shell
                    115: .It Full Name:
                    116: user's real name
1.14      aaron     117: .It Office Location:
                    118: user's office location
                    119: .It Office Phone:
                    120: user's office phone
1.1       deraadt   121: .It Home Phone:
                    122: user's home phone
                    123: .El
                    124: .Pp
                    125: The
                    126: .Ar login
                    127: field is the user name used to access the computer account.
                    128: .Pp
                    129: The
                    130: .Ar password
                    131: field contains the encrypted form of the user's password.
                    132: .Pp
                    133: The
                    134: .Ar uid
                    135: field is the number associated with the
                    136: .Ar login
                    137: field.
                    138: Both of these fields should be unique across the system (and often
                    139: across a group of systems) as they control file access.
                    140: .Pp
                    141: While it is possible to have multiple entries with identical login names
1.17      aaron     142: and/or identical user IDs, it is usually a mistake to do so.
                    143: Routines that manipulate these files will often return only one of the multiple
1.1       deraadt   144: entries, and that one by random selection.
                    145: .Pp
                    146: The
                    147: .Ar group
                    148: field is the group that the user will be placed in at login.
1.38    ! jmc       149: Since
        !           150: .Bx
        !           151: supports multiple groups (see
1.25      mpech     152: .Xr groups 1 ) ,
1.1       deraadt   153: this field currently has little special meaning.
                    154: This field may be filled in with either a number or a group name (see
                    155: .Xr group 5 ) .
                    156: .Pp
                    157: The
                    158: .Ar change
                    159: field is the date by which the password must be changed.
                    160: .Pp
                    161: The
                    162: .Ar expire
                    163: field is the date on which the account expires.
                    164: .Pp
                    165: Both the
                    166: .Ar change
                    167: and
                    168: .Ar expire
                    169: fields should be entered in the form ``month day year'' where
                    170: .Ar month
                    171: is the month name (the first three characters are sufficient),
                    172: .Ar day
                    173: is the day of the month, and
                    174: .Ar year
                    175: is the year.
                    176: .Pp
                    177: The
                    178: .Ar class
1.24      millert   179: field specifies a key in the
                    180: .Xr login.conf 5
                    181: database of login class attributes.
                    182: If empty, the
                    183: .Dq default
1.29      jmc       184: record is used.
1.1       deraadt   185: .Pp
                    186: The user's
                    187: .Ar home directory
1.35      sobrado   188: is the full
                    189: .Ux
                    190: path name where the user will be placed at login.
1.1       deraadt   191: .Pp
                    192: The
                    193: .Ar shell
                    194: field is the command interpreter the user prefers.
                    195: If the
                    196: .Ar shell
1.9       aaron     197: field is empty, the Bourne shell
                    198: .Pq Pa /bin/sh
1.1       deraadt   199: is assumed.
1.18      aaron     200: When altering a login shell, and not the superuser, the user
1.1       deraadt   201: may not change from a non-standard shell or to a non-standard
                    202: shell.
                    203: Non-standard is defined as a shell not found in
                    204: .Pa /etc/shells .
                    205: .Pp
                    206: The last four fields are for storing the user's
                    207: .Ar full name , office location ,
                    208: and
1.8       deraadt   209: .Ar work
1.1       deraadt   210: and
1.8       deraadt   211: .Ar home telephone
1.1       deraadt   212: numbers.
                    213: .Pp
                    214: Once the information has been verified,
1.12      aaron     215: .Nm
1.1       deraadt   216: uses
                    217: .Xr pwd_mkdb 8
                    218: to update the user database.
1.29      jmc       219: .Sh ENVIRONMENT
                    220: The
                    221: .Xr vi 1
                    222: editor will be used unless the environment variable
                    223: .Ev EDITOR
                    224: is set to
                    225: an alternate editor.
                    226: When the editor terminates, the information is re-read and used to
                    227: update the user database itself.
                    228: Only the user, or the superuser, may edit the information associated
                    229: with the user.
                    230: .Sh FILES
1.30      avsm      231: .Bl -tag -width /var/tmp/pw.XXXXXXXXXX -compact
1.29      jmc       232: .It Pa /etc/master.passwd
                    233: user database
                    234: .It Pa /etc/passwd
1.36      jmc       235: user database, with confidential information removed
1.29      jmc       236: .It Pa /etc/ptmp
                    237: lock file for the passwd database
                    238: .It Pa /etc/shells
                    239: list of approved shells
1.31      avsm      240: .It Pa /var/tmp/pw.XXXXXXXXXX
1.29      jmc       241: temporary copy of the user passwd information
                    242: .El
1.20      aaron     243: .Sh DIAGNOSTICS
                    244: .Bl -diag
1.37      schwarze  245: .It "Attempting to lock password file, please wait or press ^C to abort"
1.26      millert   246: .Pp
                    247: The password file is currently locked by another process;
                    248: .Nm
                    249: will keep trying to lock the password file until it succeeds or
1.32      jmc       250: the user hits the interrupt character (control-C by default).
1.26      millert   251: If
                    252: .Nm
                    253: is interrupted while trying to gain the lock any changes made will be lost.
                    254: .Pp
                    255: If the process holding the lock was prematurely terminated the lock
                    256: file may be stale and
                    257: .Nm
                    258: will wait forever trying to lock the password file.
                    259: To determine whether a live process is actually holding the lock, the
1.23      millert   260: admin may run the following:
                    261: .Bd -literal -offset indent
1.27      mpech     262: $ fstat /etc/ptmp
1.23      millert   263: .Ed
                    264: .Pp
                    265: If no process is listed, it is safe to remove the
1.20      aaron     266: .Pa /etc/ptmp
1.26      millert   267: file to clear the error.
1.1       deraadt   268: .El
                    269: .Sh SEE ALSO
1.10      alex      270: .Xr finger 1 ,
1.1       deraadt   271: .Xr login 1 ,
                    272: .Xr passwd 1 ,
                    273: .Xr getusershell 3 ,
1.24      millert   274: .Xr login.conf 5 ,
1.1       deraadt   275: .Xr passwd 5 ,
                    276: .Xr pwd_mkdb 8 ,
                    277: .Xr vipw 8
                    278: .Rs
1.22      deraadt   279: .%A Robert Morris
                    280: .%A Ken Thompson
1.4       gene      281: .%T "UNIX Password Security"
1.1       deraadt   282: .Re
                    283: .Sh HISTORY
                    284: The
                    285: .Nm
1.11      aaron     286: command appeared in
1.1       deraadt   287: .Bx 4.3 Reno .