Visit Our UNIX and Linux User Community

Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pwd_mkdb(8) [osx man page]

PWD_MKDB(8)						    BSD System Manager's Manual 					       PWD_MKDB(8)

pwd_mkdb -- generate the password databases SYNOPSIS
pwd_mkdb [-c] [-p | -s] [-d directory] [-u username] file DESCRIPTION
pwd_mkdb creates db(3) style secure and insecure databases for the specified file. These databases are then installed into /etc/spwd.db and /etc/pwd.db, respectively. The file is installed into /etc/master.passwd. The file must be in the correct format (see passwd(5)). It is important to note that the format used in this system is different from the historic Version 7 style format. The options are as follows: -c Check if the password file is in the correct format. Do not change, add, or remove any files. -d directory Operate in a base directory other than the default of /etc. All absolute paths (including file) will be made relative to directory. Any directories specified as a part of file will be stripped off. This option is used to create password databases in directories other than etc; for instance in a chroot(8) jail. -p Create a Version 7 style password file and install it into /etc/passwd. -s Only update the secure version of the database. This is most commonly used in conjunction with the -u flag during a password change. Because the insecure database doesn't contain the password there is no reason to update it if the only change is in the password field. Cannot be used in conjunction with the -p flag. -u username Only update the record for the specified user. Utilities that operate on a single user can use this option to avoid the overhead of rebuilding the entire database. This option must never be used if the line number of the user's record in /etc/master.passwd has changed. file The absolute path to a file in master.passwd format, as described in passwd(5). The two databases differ in that the secure version contains the user's encrypted password and the insecure version has an asterisk ('*'). The databases are used by the C library password routines (see getpwent(3)). pwd_mkdb exits zero on success, non-zero on failure. FILES
/etc/master.passwd current password file /etc/passwd a Version 7 format password file /etc/pwd.db insecure password database file /etc/pwd.db.tmp temporary file /etc/spwd.db secure password database file /etc/spwd.db.tmp temporary file SEE ALSO
chpass(1), passwd(1), db(3), getpwent(3), passwd(5), vipw(8) STANDARDS
Previous versions of the system had a program similar to pwd_mkdb, mkpasswd, which built dbm(3) style databases for the password file but depended on the calling programs to install them. The program was renamed in order that previous users of the program not be surprised by the changes in functionality. BUGS
Because of the necessity for atomic update of the password files, pwd_mkdb uses rename(2) to install them. This, however, requires that the file specified on the command line live on the same file system as the /etc directory. There are the obvious races with multiple people running pwd_mkdb on different password files at the same time. The front-ends to pwd_mkdb, chpass(1), passwd(1), and vipw(8) handle the locking necessary to avoid this problem. BSD
June 6, 1993 BSD

Check Out this Related Man Page

PASSWD(1)						    BSD General Commands Manual 						 PASSWD(1)

passwd, yppasswd -- modify a user's password SYNOPSIS
passwd [-l] [user] yppasswd [-l] [-y] [-d domain] [-h host] [-o] DESCRIPTION
The passwd utility changes the user's local, Kerberos, or NIS password. If the user is not the super-user, passwd first prompts for the cur- rent password and will not continue unless the correct password is entered. When entering the new password, the characters entered do not echo, in order to avoid the password being seen by a passer-by. The passwd utility prompts for the new password twice in order to detect typing errors. The total length of the password must be less than _PASSWORD_LEN (currently 128 characters). Once the password has been verified, passwd communicates the new password information to the Kerberos authenticating host. The following option is available: -l Cause the password to be updated only in the local password file, and not with the Kerberos database. When changing only the local password, pwd_mkdb(8) is used to update the password databases. When changing local or NIS password, the next password change date is set according to ``passwordtime'' capability in the user's login class. To change another user's Kerberos password, one must first run kinit(1) followed by passwd. The super-user is not required to provide a user's current password if only the local password is modified. NIS INTERACTION
The passwd utility has built-in support for NIS. If a user exists in the NIS password database but does not exist locally, passwd automati- cally switches into yppasswd mode. If the specified user does not exist in either the local password database or the NIS password maps, passwd returns an error. When changing an NIS password, unprivileged users are required to provide their old password for authentication (the rpc.yppasswdd(8) daemon requires the original password before it will allow any changes to the NIS password maps). This restriction applies even to the super-user, with one important exception: the password authentication is bypassed for the super-user on the NIS master server. This means that the super-user on the NIS master server can make unrestricted changes to anyone's NIS password. The super-user on NIS client systems and NIS slave servers still needs to provide a password before the update will be processed. The following additional options are supported for use with NIS: -y Override passwd's checking heuristics and forces it into NIS mode. -l When NIS is enabled, the -l flag can be used to force passwd into ``local only'' mode. This flag can be used to change the entry for a local user when an NIS user exists with the same login name. For example, you will sometimes find entries for system ``placeholder'' users such as bin or daemon in both the NIS password maps and the local user database. By default, passwd will try to change the NIS password. The -l flag can be used to change the local password instead. -d domain Specify what domain to use when changing an NIS password. By default, passwd assumes that the system default domain should be used. This flag is primarily for use by the superuser on the NIS master server: a single NIS server can support multiple domains. It is also possible that the domainname on the NIS master may not be set (it is not necessary for an NIS server to also be a client) in which case the passwd command needs to be told what domain to operate on. -h host Specify the name of an NIS server. This option, in conjunction with the -d option, can be used to change an NIS password on a non- local NIS server. When a domain is specified with the -d option and passwd is unable to determine the name of the NIS master server (possibly because the local domainname is not set), the name of the NIS master is assumed to be ``localhost''. This can be overrid- den with the -h flag. The specified hostname need not be the name of an NIS master: the name of the NIS master for a given map can be determined by querying any NIS server (master or slave) in a domain, so specifying the name of a slave server will work equally well. -o Do not automatically override the password authentication checks for the super-user on the NIS master server; assume ``old'' mode instead. This flag is of limited practical use but is useful for testing. FILES
/etc/master.passwd the user database /etc/passwd a Version 7 format password file /etc/passwd.XXXXXX temporary copy of the password file /etc/login.conf login class capabilities database SEE ALSO
chpass(1), kinit(1), login(1), login.conf(5), passwd(5), kerberos(8), kpasswdd(8), pam_passwdqc(8), pw(8), pwd_mkdb(8), vipw(8) Robert Morris and Ken Thompson, UNIX password security. NOTES
The yppasswd command is really only a link to passwd. HISTORY
A passwd command appeared in Version 6 AT&T UNIX. BSD
February 14, 2014 BSD

Featured Tech Videos