The shell program pwgen
is one of a number of password generation tools that creates both human-readable and machine formatted random passwords. It achieves this using /dev/urandom
and like any of these password solution programs attempt to make passwords as secure as possible, within the given parameters.
Here’s a seemingly safe password strength checker where you can gauge how secure any existing or generated passwords are: HowSecureIsMyPassword.net

I entered my main password
1 – Install pwgen
You can usually find pwgen
in your distribution’s repositories through its package manager.
Arch Linux
Using Pacman this acquires and installs the program:
[alert-announce]
- $ sudo pacman -S pwgen
[/alert-announce]
Debian / Ubuntu
Using Apt this acquires and installs the program:
[alert-announce]
- $ sudo apt-get install pwgen
[/alert-announce]
2 – Letters & Numbers
Will generate a one line password consisting of only letters and numbers, with a total of 16 characters:
[alert-announce]
- $ pwgen -1 16
[/alert-announce]
3 – Secure
Generate a one-line password with hard to memorize random characters (-s
), that has a total overall of 16 characters:
[alert-announce]
- $ pwgen -1 -s 16
[/alert-announce]
4 – Symbols
Generate a one-line password inclusive of at least one symbol -y
that has a total overall of 16 characters:
[alert-announce]
- $ pwgen -1 -y 16
[/alert-announce]
5 – Secure & Symbols
Generate a one line password with hard to memorize random characters (-s
), inclusive of at least one symbol (-y
) that has a total overall of 16 characters:
[alert-announce]
- $ pwgen -1 -sy 16
[/alert-announce]
6 – Extra Options
Don’t include numbers in the generated password with -0
and consist of 8 characters overall:
[alert-announce]
- $ pwgen -1 -0 8
[/alert-announce]
Don’t use characters that could be confused by the user when printed, such as l
and 1
, or 0
or O
‘, and consist of 8 characters overall:
[alert-announce]
- $ pwgen -1 -B 8
[/alert-announce]
Don’t include capitals in the generated password and consist of 8 characters overall::
[alert-announce]
- $ pwgen -1 -A 8
[/alert-announce]
For everything else there’s man
:
[alert-announce]
- $ man pwgen
[/alert-announce]