Linux Command Line Password Generator

Computer Security KeyI have access to a few servers/super computers that require me to change my password every 30 days.  In addition to this, after using a password I have to wait 6 months before being allowed to reuse it and new passwords cannot be similar to old password.

This can be rather annoying, as I have only 3 passwords that I have memorized (with varying levels of strength).  Whenever I am asked for a new password, I cannot just sit there and think up one; I have to use a random password generator and then I can finally relax and surf sites like O2.co.uk or my e-mails.

From the linux command line, it is rather easy to generate a password.  I use the following command in my .cshrc file:

alias gen_pass = "openssl rand -base64 \!:1"

The command is simple to use, just type ‘gen_pass’ followed by the length desired.  Example:

mturner@prospero:gen_pass 16
BT5g0agBcMF4jXsbjaBdrg==
mturner@prospero:gen_pass 12
sW9V1nehfXFzCgwL
mturner@prospero:gen_pass 8
Vnsg8qne/j8=

As you can see, the password that is generated CAN contain uppercase letters, lowercase letters, numbers, and symbols.  There are other methods of generating passwords from the command line, however this is a rather simple command that doesn’t rely on the algorithm that is used for /dev/random.

Enhanced by Zemanta

2 thoughts on “Linux Command Line Password Generator

  1. sadotmd

    As alternative there are a handy tool called apg (apt-get install apg). Or you can use a web-based one: OPG – opg.sysadmin.md

  2. %

    Awesome internet site!! Good posts. Thanks.

Leave a Reply

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

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

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