Tiny Password Generator

Password

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

3 comments

  1. I used to use openssl for this as it is usually installed on most systems:
    $ openssl rand 9 -base64
    eZq7YZEuyEY6

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.