[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Sheflug] executing a program as a certain user from a CGI/perl script
On 10 Mar 2001 06:35:00 +0000, Andrew Basterfield wrote:
> how do I run pppd from the perl script with the supplied username &
> password? I tried....
>
> open(shell, "| su $username -c pppd call $connection");
> print(shell $password);
>
> [$username, $password & $connection come from POST data from webpage]
>
> ..but 'su' won't work down a pipe. This is stretching the limits of my
> (very basic) perl so I'm lost.
I think you're trying the wrong approach. You shouldn't be asking for a
username and password via a form, you should use the in-built
Apache/HTTP authentication method with a .htaccess file. Or,
alternatively, setup the firewall rules on the gateway so that externals
host can't connect to the webserver (I assume that you're not connecting
to allow people to access the webserver - if you are, you could
alternatively setup an Apache virtual server listening to another port
and block that instead). Or, you could run pppd in demand mode and have
it connect automatically (not a worry if you're on FRIACO or something).
There, I've spotted four methods in my answer :) I would personally try
the pppd demand mode (if your dial-up allows it - i.e., don't do it if a
misconfiguration would be expensive!! I have a flat-rate dialup, for me
it's fine). It's the most automatic, but you'll have to make sure that
nothing except WWW/email and possibly ssh/telnet/dns triggers it. With
Windows computers, look out for all the CIFS/SMB stuff.
Cheers,
Alex.
---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word
"unsubscribe" in the body of the message.
GNU the choice of a complete generation.