in reply to Net::OpenSSH - connection from out a CGI script fails

Let the script create a file in /tmp then you know as which users the script runs

If the problem is the .ssh dir, would it be possible to create .ssh/known_hosts as a link to /dev/null? That would keep ssh happy writing to it (hopefully) and reading would always show an empty file

To simulate the problem. make an write-protected empty .ssh in your home dir and execute the script. Same error message means you have found the problem

If not, in many cases like this different environment variables are the culprit

  • Comment on Re: Net::OpenSSH - connection from out a CGI script fails

Replies are listed 'Best First'.
Re^2: Net::OpenSSH - connection from out a CGI script fails
by salva (Canon) on Jan 20, 2012 at 10:17 UTC
    If the problem is the .ssh dir, would it be possible to create .ssh/known_hosts as a link to /dev/null? That would keep ssh happy writing to it (hopefully) and reading would always show an empty file

    That opens the door for man-in-the-middle attacks!

      Sure, but it is not worse than the directory where there is no .ssh and no writing allowed at all (i.e. the situation as it seems to be now)

        I have similar problem but i can't find other way, i think that is better create a pair keys public between host for resolve the problem...