makepasswd
generates random passwords suitable for user accounts
TLDR
Generate random password
SYNOPSIS
makepasswd [--count n] [--chars n] [--string chars] [--crypt] [options]
DESCRIPTION
makepasswd generates random passwords suitable for user accounts. It uses /dev/urandom for randomness, producing cryptographically suitable output.
By default, it generates a single password of reasonable length using letters and digits. The string option customizes the character set for specific password policies.
The crypt options produce password hashes suitable for /etc/shadow. MD5 crypt produces hashes starting with $1$, compatible with modern systems. DES crypt is legacy and limited to 8 characters.
Batch generation with count is useful for provisioning multiple accounts. Combined with proper length and character requirements, it meets most password policies.
For scripting, passwords output one per line. When combined with crypt, both cleartext and hash appear for reference.
PARAMETERS
--count N
Generate N passwords.--chars N
Password length.--minchars N
Minimum length.--maxchars N
Maximum length.--string CHARS
Characters to use.--crypt
Output DES-crypted password.--crypt-md5
Output MD5-crypted password.--clearfrom FILE
Read cleartext from file.--cryptsalt N
Salt for crypt.--randomseed
Use random seed.--rerandom N
Re-seed every N passwords.
CAVEATS
DES crypt limited to 8 characters - use MD5. Random passwords hard to remember. Generated passwords should be changed by users. Some special characters may cause shell issues.
HISTORY
makepasswd was written by Rob Browning for Debian in the 1990s. It provided a simple tool for system administrators to generate passwords during account creation. The package remains in Debian and derived distributions.
