My Simple Trick for Quickly Making Secure Passwords

I’m frequently required to make test accounts on various systems. I need to create passwords that are obnoxiously long and complex many times in a day. My method for creating those passwords requires OpenSSL to be installed on my workstation:

$ alias secpass="openssl rand -base64 24"
$ secpass
$ thvxAWI5RT9Skmb/9zQ041zxF+P2enKe

A base 64 password has, in some cases, caused certain poorly designed systems to choke if there are special symbols included. In those cases I use the -hex option:

$ alias hexpass="openssl rand -hex 24"
$ hexpass
$ e1289af1316f33c91346c5512465c8488e6f2b5c3ff588fc

Ta da! Instant passwords as long and obnoxious as you please.


  1. bobmccouch

    September 12, 2014 at 10:56 am

    Another option is using a simple *nix utility called ‘pwgen’. The “pwgen -sy ‘ command will generate a list of long passwords with alpha, numeral, and symbol character sets. Then I just find one I like the looks of, or sometimes I generate a list of short ones like 4 or 6 characters and concatenate several of them with a randomly chosen character (to help guard against any seeding weakness in the utility).


  2. Lucas Kauffman

    September 14, 2014 at 10:09 pm

    You should be fine on entropy level on the last one (considering its length) but due mind that often password policies require you to use special characters and caps.


  3. Andreas Paul (@xorpaul)

    October 24, 2014 at 3:12 am

    Another option is just using /dev/random and trim it:

    cat /dev/urandom|tr -dc “a-zA-Z0-9-_\$\?”|fold -w 24|head

    No need to install addition packages like openssl or pwgen


Leave a Reply

Follow TheNubbyAdmin!

follow us in feedly

Raw RSS Feed:

Contact Me!

Want to hire me as a consultant? Have a job you think I might be interested in? Drop me a line:

Contact Me!

Subscribe via Email

Your email address is handled by Google FeedBurner and never spammed!

The Nubby Archives

Circle Me on Google+!

Photos from Flickr

Me on StackExchange

The IT Crowd Strava Group

%d bloggers like this: