LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 11-29-2003, 04:08 PM   #1
linuxgamer
Member
 
Registered: Sep 2003
Distribution: SuSE, Linspire, Fedora, RH Enterprise
Posts: 89

Rep: Reputation: 15
Help: Need random password generator


Need random password generator from a reliable source.
I wont download from small unknown web sites.
This is what I used on Windows, but need a replacement
for SuSE 9.0 Pro.

http://quickysoftware.com/passwordgenerator.html

THX
 
Old 11-29-2003, 05:13 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 65
Here you go I just wrote you one:
Code:
#!/usr/bin/perl

if($ARGV[0]>5 && $ARGV[0]<20){
@chars = ('a'..'z', 'A'..'Z', '0'..'9', '.', '!');
for($a=0;$a<$ARGV[0];$a++){print $chars[int(rand(@chars))]}
}
else{print "Please pass the length of password you want as an argument\nIt must be between 5 and 20"}
print "\n";

exit;
 
Old 11-29-2003, 06:43 PM   #3
chup
Member
 
Registered: Aug 2003
Location: South Africa
Distribution: Ubuntu (Feisty)
Posts: 280

Rep: Reputation: 30
i have emerged an app on my gentoo system, its called makepasswd, and obviously it generates passwords
here's the homepage of the application: http://packages.debian.org/stable/admin/makepasswd.html

[edit]
i just found another app, but i haven't tried it though:
http://sourceforge.net/projects/pwgen/
[/edit]

Last edited by chup; 11-29-2003 at 06:48 PM.
 
Old 11-29-2003, 10:43 PM   #4
speck
Member
 
Registered: Nov 2001
Location: California
Distribution: Slackware 14.1
Posts: 283

Rep: Reputation: 56
I'm not positive about Suse, but you should have a program already installed called "mkpasswd". Type "man mkpasswd" for options and examples.

Speck
 
Old 12-02-2003, 04:30 AM   #5
linuxgamer
Member
 
Registered: Sep 2003
Distribution: SuSE, Linspire, Fedora, RH Enterprise
Posts: 89

Original Poster
Rep: Reputation: 15
Hmm, looking for more of a GUI program to generate between 10 and 20 passwords
at a time so that I can copy and paste them for some customers.
Trying to install pwgen, but I dont think there is any documentation.
 
Old 12-02-2003, 02:01 PM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 65
Then why not use an adapted version of my script above. Create a file called "/usr/bin/makepass.pl" with:
Code:
#!/usr/bin/perl

&genpass;

sub genpass{
$choice="";
$length="";
$num="";

while($length<5 || $length>20){
print "\nPlease the length for the passwords between 5 & 20: ";
$length=<STDIN>;
chop $length;
}

while($num<1 || $num>25){
print "\nPlease the number of passwords you want between 1 and 25: ";
$num=<STDIN>;
chop $num;
}

@chars = ('a'..'z', 'A'..'Z', '0'..'9', '.', '!');
for($a=0;$a<$num;$a++){
for($b=0;$b<$length;$b++){
print $chars[int(rand(@chars))];
}
print "\n";
}

while($choice ne "y" && $choice ne "n"){
print "\nDo you want to go again? (y/n): ";
$choice=<STDIN>;
chop $choice;
}
if($choice eq "y"){&genpass;}
}

exit;
make it executable:
chmod 755 /usr/bin/makepass.pl

You can then run "makepass.pl" from a terminal or to make it act more like a gui app make a shortcut/menu item to:
xterm -e "/usr/bin/makepass.pl"
 
  


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
does GNU's g77 come with a random number generator? terrence Programming 1 08-30-2005 10:29 PM
Want an easy password generator? Try this :) taskara Linux - General 4 07-25-2005 12:02 AM
written a password generator in C, get it here lepricaun General 1 08-09-2004 08:12 AM
Webmin automatic password generator ToBe Linux - General 2 08-26-2003 10:42 AM
Random number generator for linux Steve_Taylor Programming 12 09-30-2001 05:21 PM


All times are GMT -5. The time now is 04:22 PM.

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