LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 03: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, 04:13 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
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, 05:43 PM   #3
chup
Member
 
Registered: Aug 2003
Location: South Africa
Distribution: Ubuntu (Feisty)
Posts: 280

Rep: Reputation: 31
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 05:48 PM.
 
Old 11-29-2003, 09:43 PM   #4
speck
Member
 
Registered: Nov 2001
Location: US
Distribution: Slackware 14.2
Posts: 375

Rep: Reputation: 115Reputation: 115
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, 03: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, 01:01 PM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
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



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 09:29 PM
Want an easy password generator? Try this :) taskara Linux - General 4 07-24-2005 11:02 PM
written a password generator in C, get it here lepricaun General 1 08-09-2004 07:12 AM
Webmin automatic password generator ToBe Linux - General 2 08-26-2003 09:42 AM
Random number generator for linux Steve_Taylor Programming 12 09-30-2001 04:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:03 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
Open Source Consulting | Domain Registration