Simple Cross Platform Password Generation using pwgen

Written by James McDonald

September 30, 2009

If, like me, you lack a certain amount of inspiration when trying to generate secure passwords pwgen may be the answer for you. It has heaps of options (see below) and can assist you to generate new secure passwords for your users. Thanks to the cygwin project you can use it on Windows aswell.

For Ubuntu:

sudo apt-get install pwgen

For Windows:
Download and Install cygwin and select to install pwgen

Usage Example:

you@yourbox:~$ pwgen 9 1
# generates 1 password 9 characters long with the default options


bash-3.2$ pwgen --help
Usage: pwgen [ OPTIONS ] [ pw_length ] [ num_pw ]

Options supported by pwgen:
  -c or --capitalize
        Include at least one capital letter in the password
  -A or --no-capitalize
        Don't include capital letters in the password
  -n or --numerals
        Include at least one number in the password
  -0 or --no-numerals
        Don't include numbers in the password
  -y or --symbols
        Include at least one special symbol in the password
  -s or --secure
        Generate completely random passwords
  -B or --ambiguous
        Don't include ambiguous characters in the password
  -h or --help
        Print a help message
  -H or --sha1=path/to/file[#seed]
        Use sha1 hash of given file as a (not so) random generator
        Print the generated passwords in columns
        Don't print the generated passwords in columns
  -v or --no-vowels
        Do not use any vowels so as to avoid accidental nasty words



  1. Creating Passwords that don’t Require a Keyboard Epiphany using pwgen | The Southern IT Observer - […] rediscovered pwgen which I had forgotten all […]

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…