.htpassswd and perl

Hi,
I have just setup a .htpasswd password thing on one of the directories of my web page.  I would like to have a perl script that would create user names and passwords. I think  the easiest way for it to work, would be to have it run some UNIX comands. But I do not know how to get it to do that.  Because when you are adding a user it asks for  the password twice.  Here is the commands that I use (when in my telnet app).

cd htdocs
cd login
htpasswd .htpasswd USER NAME

then asks for password twice so I type it in twice.  That is what I can't figure out how to do.  I know it can be done cause experts-exchange uses it for their member system.


thanks!!
LVL 1
stevenc317Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

stevenc317Author Commented:
ozo what do i do when I get there?  It sends me to a ftp site.  
0
ozoCommented:
You might try downloading the HTTPD-Tools-0.55.tar.gz file there,
and seeing if the HTTPD module for managing ccess control files does what you want.
(unless you can tell by the HTTPD-Tools-0.55.readme that it does not,
in which case you might clarify your question)

On the second part of your question, try looking at $ENV{'REMOTE_USER'}
0
Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

stevenc317Author Commented:
Ok the second part works, THANKS!!!  I will check out that page now!  If you would like to see the second thing in action please go to html.tou.com/  (for sign up for a login id).

thanks

SO MUCH!!!
0
stevenc317Author Commented:
I can't get the fiel to install, have an other ideas?
0
ozoCommented:
What problems did you have intalling?
Did you report the problem as instructed?
0
stevenc317Author Commented:
I typed in make (the command they say to use) and it came up with an error.  and no i did not report it.
0
stevenc317Author Commented:
Edited text of question
0
ozoCommented:
What errors did it come up with?

To do a telnet from perl, see
http://www.perl.com/CPAN/doc/manual/html/pod/perlfaq8/Can_I_use_perl_to_run_a_telnet_o.html
http://www.perl.com/CPAN/doc/wwwman/libnet/Net/Telnet.html
http://www.perl.com/CPAN/authors/id/JROGERS/Net-Telnet-3.00.readme
To run interactive user commands, see
http://www.perl.com/CPAN/authors/id/ERICA/Comm.pl-1.8.tar.gz

BTW, I can't seem to find your other question, qid=8630023345 "HELP"
about $member eq 'webmaster'

0
stevenc317Author Commented:
I will look into those pages!

Sorry bout that, I deleted it.  Since you answered my question there was no need to leave it up.  If you just wanted to see what is said, I said thanks.
0
ozoCommented:
I think the idea of this site is to grade the best answers and leave
them with previously asked questions for others to benefit from.
(but I suppose it was too specific a question to be of much general interest)
0
stevenc317Author Commented:
Well I usually do that, but your answer worked perfectly!


0
ozoCommented:
That's a switch, most people want to delete the useless answers :-)
0
stevenc317Author Commented:
<g>
0
stevenc317Author Commented:
http://www.perl.com/CPAN/authors/id/JROGERS/Net-Telnet-3.00.readme

looks good, but I alwasy have trouble installing things like that.  With the make commands.  In what directory should I install it from?  I have tried in the home dir (i think it is called that, it is the directory that comes up when I login).

can u please tell me where to install that thing?
0
stevenc317Author Commented:
Edited text of question
0
ozoCommented:
On question 8630023522, I meant to say you could add diagnostics like
 || die "Can't open logfile.txt because $!";
and
 print "Mail status: $?\n";
at the end of the existing
 open(TLOG, "logfile.txt")
and
  close MAIL;
statements, not that you should add them as completly new lines.
And when called through cgi, the error messages will go to the
server error log, and not back to the browser.

0
stevenc317Author Commented:
thanks for answering that question, sorry i can't give you the credits (cause I ened this question answered).  I just put a new question up (I think i called it Mail ...) it should be at the top.  If you can answer that one I will give you the 45 points.  (sorry all i have).

thanks!
0
ozoCommented:
Also, given your
   # read in templog
                open(TLOG, "logfile.txt");
                while (<TLOG>) {
                $sendThis .= $_;
                }
                close TLOG;
It seems redundant to have
  # clear templog
                rename("logfile.txt","logfile.$$");
                open(TLOG,"logfile.$$");
                {local $/=undef;$SendThis=<TLOG>}
                close TLOG;
                unlink "logfile.$$";  
I think the latter was meant to replace the former

0
stevenc317Author Commented:
what do u mean?
0
malecCommented:
Why not use normal server tools? Even FastTrack lets you control access?
0
stevenc317Author Commented:
I want it to be in perl, sorry but that is how i want it done.

thanks anyway,

Steven
0
kistlerCommented:
You may separately ask for the same password twice with
java script on the www page, and only submit, if it's the
same, and then put it with perl into a database. And perl
has the crypt command to use as: crypt(passwd,salt); But maybe
I did not propperly understand the question....
0
4099aolCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.