For starters, any idea how apache/httpd runs or executes other scripts?

You'll need to look at the http.conf to see what the username and group name are for the web server. ps -ef or ps -aux should also shed some light on the subject.

Once you have this information, then you can su to this user and try ssh <somehost> pwd to see what it says, as this is closer to how the perl script would run it under cgi. It would actually run as this user without a tty, but that is harder to simulate.

If you've generated keys as your userid, you may need to use ssh user@host to ssh to a different account. man ssh would have information on how to do this. Most likely, you'll also need to copy the private keys to the web server account.

Last, mode 777 is evil!. The directories/scripts should be mode 755, as write permission is not needed to run the scripts. Leaving them mode 777 allows anybody with access to that box to change your scripts and files (either maliciously or accidentally).

And, of course, read all the documentation you can find on apache and ssh. Hope this helps you on your way.


In reply to Re: Re: Re: Problem with Apache and SSH: Help needed! by jeffenstein
in thread Problem with Apache and SSH: Help needed! by The Crumpet

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.