Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
#!/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;
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.
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"
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.