MKPASS(1) General Commands Manual MKPASS(1)

mkpassmake a password

mkpass [-l length] [chars]

The mkpass utility allows you to easily create randomly-generated passwords from the command-line. By default, mkpass generates a 64-character long password of printable characters. If specified, the generated password will only contain characters found in chars. You may use tr(1) range syntax, as shown in the EXAMPLES section.

The options are as follows:

length
Generate a password length characters in length.

The mkpass utility exits 0 on success, and >0 if an error occurs.

Generate a password:

$ mkpass

Generate a password with a length of 40:

$ mkpass -l 40

Generate an alphanumeric password:

$ mkpass '[:alnum:]'

Generate a password containing only the lowercase letters of the latin alphabet:

$ mkpass a-z

head(1), totp(1), tr(1)

Thomas Voss <mail@thomasvoss.com>

April 13, 2026 Void Linux