LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

makepasswd

generates random passwords suitable for user accounts

TLDR

Generate random password
$ makepasswd
copy
Generate multiple passwords
$ makepasswd --count [5]
copy
Generate password of specific length
$ makepasswd --chars [16]
copy
Generate with specific character set
$ makepasswd --string '[A-Za-z0-9!@#]'
copy
Generate a crypted password (for /etc/shadow, MD5 scheme)
$ makepasswd --crypt-md5
copy
Use a fixed random seed for reproducible output
$ makepasswd --randomseed [42] --count [3]
copy
Specify minimum and maximum length
$ makepasswd --minchars [8] --maxchars [12]
copy

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 N
Seed the random generator with N (use 0 for true randomness, a fixed value for reproducibility).
--rerandom N
Re-seed the random generator every N passwords.
--repeatpass N
Emit each generated password N times (useful with --crypt to pair cleartext with hash).
--nocrypt
Skip cryptographic hashing and output the cleartext only.
--verbose, --noverbose
Toggle explanatory output.

INSTALL

sudo dnf install makepasswd
copy
sudo apk add makepasswd
copy

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.

SEE ALSO

pwgen(1), apg(1), openssl(1), passwd(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid