in reply to Re^4: Net::OpenSSH + CGI problem
in thread Net::OpenSSH + CGI problem

Yes, works great on command line, and using the www-data user as well from command line...

I read through the FAQ but I'll look again with fresh eyes. Any other thoughts?

Maybe I'll put a sniffer on it and watch the packets.

Replies are listed 'Best First'.
Re^6: Net::OpenSSH + CGI problem
by salva (Canon) on Feb 17, 2017 at 18:35 UTC
    The issue seems related to STDIN being closed when called from the CGI. It looks like a bug in the Cisco SSH implementation.

    Try creating a pipe and passing the read side as the stdin stream.

      I am now able to recreate this from the command line. If I have the script call /bin/bash instead of what I want to type and then I run the script (from command line), and then I run the cgi manually, it fails in the same manner as CGI.

      The user is correct (www-data) but there are no environment variables set..?

        Then, enable debugging in both cases and post here the output. That would allow us to see what's different.
        I don't remember who inspired me to this cgi debug script (either someone here or on reddit), but I think it would be useful in your case, too.