Found on Korben’s Blog, a nice way to generate a random password on UNIX:
# < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c8 tOULPeOk
Just create an alias for a more convenient day-to-day use:
# alias gen_pw='< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c8' # gen_pw wbk0ewpn
Note: this works only with the GNU version of head. Solaris or BSD versions have no '-c' flag!
Source: http://www.korben.info/creer-un-mot-de-passe-aleatoire-avec-linux.html
Neat info / Will come back!!
I used to use openssl for this as it is usually installed on most systems:
$ openssl rand 9 -base64
eZq7YZEuyEY6