Thursday, August 31, 2006

Random password one-liner

I recently came up with this method for generating reasonable random 8-character passwords:

$ dd if=/dev/random bs=6 count=1 2>/dev/null | openssl base64
LCia46S4
If 8 characters is not long enough, increase the number after bs= to 75% of the number of characters you would like in the password.

2 comments:

Anonymous said...

Thanks for replying to my OpenSolaris posting. I'm still discussing with other Sun folks... Iwan, Sun Singapore.

Anonymous said...

You could get rid of the "dd" with:

openssl rand -base64 6