mkpasswd(8) — Maintenance
OSF
NAME
mkpasswd − Creates a version of the basic user database organized for efficient searches
SYNOPSIS
/usr/sbin/mkpasswd [−v] tempfile
FLAGS
-v Specifies that each stored entry be listed on standard output
DESCRIPTION
The mkpasswd command creates an auxiliary version of the basic user database in a form organized for efficient searches. The command reads the user attributes in the /etc/passwd file and creates a version in the /etc/passwd.xx file, or the file you specify with the tempfile argument, by applying a hashing algorithm with look-aside search capabilities. The hashing algorithm minimizes the search time needed for the getpwuid subroutine and the getpwnam subroutine to retrieve information.
Following an edit of the /etc/passwd file, the vipw command calls the mkpasswd command to create a version of the database in the ptmp temporary file.
To use the ptmp file, you must have write access to the file as well as to the ptmp.pag file and the ptmp.dir file. If they do not exist, you must have write access to the /etc directory. For this reason, it may be better for an individual to use the /tmp directory or the /usr/tmp file.
Only the root user should have execute access to this command. The command should be setgid to the passwd group to have access to the user database. The passwd group should have access to all of the following files.
ModeFile
r/etc/passwd
rw/etc/passwd.pag
rw/etc/passwd.dir
rwtempfile
rwtempfile.pag
rwtempfile.dir
EXAMPLES
To organize the basic user database for efficient searches and store it in the ptmp file, enter:
mkpasswd /usr/tmp
An auxiliary version of the basic user database is created with a hashing algorithm.
EXIT VALUES
The mkpasswd command exits with a nonzero exit code if any errors are detected.
FILES
/usr/sbin/mkpasswd
Specifies the command path
RELATED INFORMATION
Command: /usr/sbin/vipw(8)