Installation guide
To edit the passwd file:
1. Log in as root.
2. Enter the vipw command to add the required line entry to the passwd
file:
# vipw
root:TZVtfX5VbS3KY:0:1:System PRIVILEGED Account,,,:/:/bin/sh
daemon:*:1:daemon
uucp:*:2:uucp
.
.
.
marcy:*:201:20:Marcy Swanson,dev,x1234:/usr/users/marcy:/bin/sh
The previous example shows that user marcy has a UID of 201 and a
GID of 20. The login directory is /usr/users/marcy and the Bourne
shell (/bin/sh) is defined as the login shell. Since the password field
contains an asterisk (*), user marcy cannot log in to the system.
Section 9.2.1.4 describes how to add a password to the passwd file.
3. Close the file.
If a hashed passwd database exists, vipw uses the mkpasswd command to
re-create it. A hashed passwd database is an indexed database that allows
for faster searches of the passwd file. The following example shows the
message displayed after closing the passwd file where a hashed passwd
database existed previously:
10 password entries, maximum length 88
If a hashed passwd database does not exist, a message is displayed
informing you that passwd it does not exist and asks if you want a
database created. If you want a hashed passwd database, enter yes at the
prompt. If you do not want a hashed passwd database, enter no at the
prompt. Refer to vipw
(8) for more information.
Note that when the /etc/passwd file is very large, a performance
degradation may occur. If the number of passwd entries reaches the 30,000
to 80,000 range or greater, mkpasswd will sometimes fail to create a
hashed (ndbm) database. Because the purpose of this database is to allow
for efficient (fast) searches for password file information, failure to build it
causes commands that rely on it to do a linear search of /etc/passwd.
This results in a serious performance degradation for those commands.
If you use use the mkpasswd -s option to avoid this type of failure, a
potential database or binary compatibility problem may arise. If an
application that accesses the password database created by mkpasswd is
built statically (nonshared), that application will be unable to read from or
write to the password database correctly. This would cause the application
to fail either by generating incorrect results or by possibly dumping core.
9–10 Administering User Accounts and Groups