1. Computing & Technology
Linux / Unix Command: mkpasswd
Command Library
NAME
mkpasswd
SYNOPSIS
mkpasswd [ -fvgps ] file
DESCRIPTION
mkpasswd reads the file in the format given by the flags and converts it to the corresponding database file format. These database files are used to improve access performance on systems with large numbers of users. The output files are named file.dir and file.pag.
OPTIONS
-f
causes mkpasswd to ignore any existing output files and overwrite them. Normally mkpasswd complains about existing output files and quits.

-v
causes mkpasswd to output information about each record as it is converted, with a final message at the very end.

-g
treats the input file as though it were in /etc/group file format. When combined with the -s option, the /etc/gshadow file format is used instead.

-p
treats the input file as though it were in /etc/passwd file format. This is the default. When combined with the -s option, the /etc/shadow file format is used instead.

EXAMPLE

% mkpasswd -l 10

makes a hard-to-guess, random password of the length of 10 characters.

Important: Use the man command (% man) to see how a command is used on your particular computer.

>> Linux Command Library Index

>> Also see Shell Command Library

Discuss in my forum

©2012 About.com. All rights reserved.

A part of The New York Times Company.