kburns1969 has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I have a perl script which uses Net::SSH which runs fine as a terminal .pl file but will not work when run as a CGI script from a web browser. The second it tries to make a SSH login "$ssh->login()" call the script just dies with no error. Any ideas ? Thanks But works as a .pl script.

Replies are listed 'Best First'.
Re: Net:SSH from CGI Script
by Illuminatus (Curate) on Oct 01, 2009 at 23:01 UTC
    Keep in mind that scripts run from a web server run as the userid of the server (unless the setuid bit is set, and the server allows such things). It also may not be using the home directory you expect...

    Update wait a minute -- Net::SSH doesn't even have a login method. Maybe you are using Net::SSH::Expect?

      Yes I'm sorry. I am using Net:SSH:Expect. What information does the web server need and how can I fix it ? Thanks !
        I think you are going to need to post a code snippet. If you want to find out if it is a permissions issue, You should be able to simply run su - <web-user-id> from root (assuming it is on *nix/Linux), and try your script from the command line again.