add or change user database information
allows editing of the user database information associated
or, by default, the current user.
The information is formatted and supplied to an editor for changes.
Only the information that the user is allowed to change is displayed.
If YP is enabled change requests are first tried in the local database,
and then in the YP database, if there was no entry to change locally.
are synonyms for
The options are as follows:
The superuser is allowed to directly supply a user database
entry, in the format specified by
as an argument.
This argument must be a colon
separated list of all the
user database fields, although they may be empty.
This operation is not supported in YP environments; only local additions
can be performed which requires the
flag to be specified.
In environments where YP is enabled, always alter local information as
opposed to information in YP.
Attempts to change the user's shell to
In environments where YP is enabled, always change the YP entry, even if this
is a modification request and there is a local entry for the specified user.
Possible display items are as follows:
user's login name
user's encrypted password
user's login group
password change time
account expiration time
user's general classification
user's home directory
user's login shell
user's real name
user's office location
user's office phone
user's home phone
field is the user name used to access the computer account.
field contains the encrypted form of the user's password.
field is the number associated with the
Both of these fields should be unique across the system (and often
across a group of systems) as they control file access.
While it is possible to have multiple entries with identical login names
and/or identical user IDs, it is usually a mistake to do so.
Routines that manipulate these files will often return only one of the multiple
entries, and that one by random selection.
field is the group that the user will be placed in at login.
Since BSD supports multiple groups (see
this field currently has little special meaning.
This field may be filled in with either a number or a group name (see
field is the date by which the password must be changed.
field is the date on which the account expires.
fields should be entered in the form ``month day year'' where
is the month name (the first three characters are sufficient),
is the day of the month, and
is the year.
field specifies a key in the
database of login class attributes.
If empty, the
record is used.
is the full
path name where the user will be placed at login.
field is the command interpreter the user prefers.
field is empty, the Bourne shell
When altering a login shell, and not the superuser, the user
may not change from a non-standard shell or to a non-standard
Non-standard is defined as a shell not found in
The last four fields are for storing the user's
fullname , office location,
Once the information has been verified,
to update the user database.
editor will be used unless the environment variable
is set to
an alternate editor.
When the editor terminates, the information is re-read and used to
update the user database itself.
Only the user, or the superuser, may edit the information associated
with the user.
a Version 7 format password file
lock file for the passwd database
list of approved shells
temporary copy of the user passwd information
The password file is currently locked by another process;
will keep trying to lock the password file until it succeeds or
the user hits the interrupt character (control-C by default).
is interrupted while trying to gain the lock any changes made will be lost.
If the process holding the lock was prematurely terminated the lock
file may be stale and
will wait forever trying to lock the password file.
To determine whether a live process is actually holding the lock, the
admin may run the following:
$ fstat /etc/ptmp
If no process is listed, it is safe to remove the
file to clear the error.