Not a lot of information to go on, but I'll give it a shot anyway.

My guess is that the account that the cgi script runs as is different than the account you are using on the command line, and is not authorized to connect to the remote hosts.

Another possible problem is if you are using the ssh-agent for authentication, as the cgi script will not pick up the required environment variables.

Also, if you are using ssh to access new hosts, it will need a tty to ask for confirmation about new host keys. This could be combined with the first problem. If the web server account has never used ssh to access the other hosts, the first time it accesses each host it will need a tty to ask for confirmation about the host key, even if you have successfully used ssh from another account (including root) on the same server to access the other host.


In reply to 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.