May 24, 2009

CLI TIP#1 - generating really random passwords

CLI Tip #1 mkpasswd

Hi folks,  I love working on the command line interface (CLI), aka terminal or console, so  most of my blog entries will be about a simple, easy to use and (I hope so) useful tip. 

 Do you need a really random password, say 10 characters long, use this:

 mkpasswd -l 10

 This will generate a 10 characteres long string

 You need at least 4 digits, and 3 uppercases and none special character in a 15 characters password:

 mkpasswd -d 5 -C 3  -s 0 -l 15

 You can even apply immediately the password to any valid user, just use his/her username at the end of the command and ready, of course, dont forget to tell the guy about his new password.

Mkpasswd is part of the "expect" package, so if you dont have, no problem, just install expect with your favorite installer.

Cheers, and wait for my next CLI tip.


Click Here!