LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 07-21-2005, 06:12 PM   #1
taskara
Member
 
Registered: Jul 2003
Location: Canberra, Australia
Distribution: Kororaa
Posts: 34

Rep: Reputation: 15
Want an easy password generator? Try genpass :)


Greetings,

My friend Matthew Oliver and I have worked on a GPL password generator script that creates decent random passwords for Linux users (genpass - the random password generator).

If you would like to check it out, you can download the tarball here, and extract where you like (prob /usr/local/bin).

Or, if you're a Gentoo user we have an ebuild here.

Simply extract to your portage overlay (default is /usr/local/portage, but I use /usr/portage/local).
Code:
tar -zxvf genpass-0.3-ebuild.tar.gz -C /usr/local/portage
and unmask it
Code:
echo "sys-apps/genpass ~x86 >> /etc/portage/package.keywords"
(substitute ~x86 for your arch, ie ~amd64)

Then emerge it
Code:
emerge -av genpass
once you have it, run
Code:
genpass --help
and you should get
Code:
chris@josiah ~ $ genpass --help
Usage: genpass [-L <number>] [-n <number>] [-a <number>] [-u <number>] [-l <number] [-s <number>]

Generates a random password
-L, --length    Specifies the length of the password.
                Default = 8
-n, --number    Specifies the number of number characters in the password.
                Default = 0 *
-a, --ascii     Specifies the number of ascii characters in the password.
                Default = 0 *
-u, --upper     Specifies the number of uppercase characters in the password.
                Default = 0 *
-l, --lower     Specifies the number of lowercase characters in the password.
                Default = 0 *
-s, --space     Specifies the number of space characters in the password.
                Default = -1 *

*: (-1 = none, 0 = any, >0 = at least the specified number)
enjoy!

There are probably other easier ways to do this, but it was fun and we hope else someone finds it useful

Let us know your thoughts.

Cheers,
Chris & Matt

Last edited by taskara; 07-25-2005 at 12:09 AM.
 
Old 07-22-2005, 07:24 AM   #2
rodeoclown
Member
 
Registered: Feb 2003
Posts: 44

Rep: Reputation: 15
Or if you have perl installed, which I think every Linux distro comes with you can use the String::Random module to do this with about 3 lines of code....

http://www.mathematik.uni-ulm.de/hel...ng/Random.html

 
Old 07-23-2005, 07:53 AM   #3
taskara
Member
 
Registered: Jul 2003
Location: Canberra, Australia
Distribution: Kororaa
Posts: 34

Original Poster
Rep: Reputation: 15
that's pretty cool

still it was fun to make

I guess you could think of genpass as the perl random_string module for bash
imagine how much code there is behind the random_string module.
And for people who don't know how to use the "complex" perl commands, genpass makes it easy.

Not to mention, with genpass you can do it in one line! :P hehe

And not that anyone seems interested, but version 0.2 is out

cheers

Last edited by taskara; 07-23-2005 at 07:58 AM.
 
Old 07-24-2005, 05:58 PM   #4
rodeoclown
Member
 
Registered: Feb 2003
Posts: 44

Rep: Reputation: 15
Quote:
Originally posted by taskara
that's pretty cool

still it was fun to make

I guess you could think of genpass as the perl random_string module for bash
imagine how much code there is behind the random_string module.
And for people who don't know how to use the "complex" perl commands, genpass makes it easy.

Not to mention, with genpass you can do it in one line! :P hehe

And not that anyone seems interested, but version 0.2 is out

cheers
Well the module is only 492 lines long but since its a module, the actual code of the perl script would be:

Code:
  use String::Random;
  $pass = new String::Random;
  print "Your password is ", $pass->randpattern("CCcc!ccn"), "\n";
3 total lines for your perl script to generate your random string password.. which then you would customize and probably only end up being a few more lines longer.. then the actual perl script would run just like your bash script, from the command line, so it would also be done from one line..
 
Old 07-25-2005, 12:02 AM   #5
taskara
Member
 
Registered: Jul 2003
Location: Canberra, Australia
Distribution: Kororaa
Posts: 34

Original Poster
Rep: Reputation: 15
oh well, perhaps it's a useless little tool

but version 0.3 is out

and I like it

cheers
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
written command line password generator lepricaun Programming 6 08-11-2004 01:36 AM
written a password generator in C, get it here lepricaun General 1 08-09-2004 08:12 AM
password for ftp site? (real easy question) vdogvictor Slackware 3 05-27-2004 01:53 PM
Help: Need random password generator linuxgamer Linux - Software 5 12-02-2003 02:01 PM
Webmin automatic password generator ToBe Linux - General 2 08-26-2003 10:42 AM


All times are GMT -5. The time now is 03:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration