Luckily, a colleague at work pointed out an easy way of generating good passwords using /dev/urandom on Linux:
head -c 500 /dev/urandom | tr -dc a-z0-9A-Z | head -c 16; echo
On HP-UX, run:
head -n 500 -c /dev/urandom | tr -dc a-z0-9A-Z | head -n 16 -c
Note you can change the "16" in the final call to head to get a different password length of your choice.
FOLLOWUP 2/7/09:
If you'd like to generate several random passwords using a shell/Bash script, see my post on HOWTO: Generating Many Good Random Passwords 'Automagically'.
FOLLOWUP 6/8/09:
David Douthitt at UNIX Administratosphere recently covered a great way to generate passwords using Perl. His method is especially useful on HP-UX and OpenVMS boxes. Thanks, David!
- Include numbers, symbols, upper and lowercase letters in passwords.
- Password length should be around 12 to 14 characters.
- Avoid any password based on repetition, dictionary words, letter or number sequences, usernames, relative or pet names, or biographical information (eg, dates, ID numbers, ancestors names or dates, ...).


Did you find this post helpful, or at least, interesting?