//View Tip #885
» Get real names of current users
» Get latest stable version of the Linux kernel
» Get your IP in one line
» Subtract one file from another
Steve Drees
Similar Tips
» Moved Trac and Subversion repositories to another machine/direct» Get real names of current users
» Get latest stable version of the Linux kernel
» Get your IP in one line
» Subtract one file from another
Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
Generate a random 8 character password containing a-z, A-Z and 0-9:
egrep -ioam1 '[a-z0-9]{8}' /dev/urandomComments
Add your comment
Comments are currently disabled
#1
On linux I greatly prefer to use pwgen.
Posted 2009-09-16 08:51:00
egrep -oam1 '[A-Za-z0-9]{8}' /dev/random
works much better for me. Dropping the -i option and including A-Z in the regexp speeds it up alot.
works much better for me. Dropping the -i option and including A-Z in the regexp speeds it up alot.
Posted 2009-09-16 10:33:36
There's a perl program that already does this called makepasswd. To use:
makepasswd --chars=20
or you can even add it directly to a user:
usermod -p `makepasswd --chars=20` user
makepasswd --chars=20
or you can even add it directly to a user:
usermod -p `makepasswd --chars=20` user
Posted 2009-09-21 05:57:58
None of these work verbatim on Solaris 10. In Solaris Land, "egrep" has no "o", "a", or "m" options and "head" has no "c" option. Also, stock "egrep" doesn't support "{}".
Slight correction: the "openssl" trick does work.
Slight correction: the "openssl" trick does work.
Posted 2009-11-12 10:50:34

