OK, so here is where I am now. The apache user does not have a home directory so I have:
  1. created a directory, /var/www/localhost/htdocs/switchdb/.ssh
  2. I added id_dsa and id_rsa from my own user .ssh directory
  3. created an identity file with the connection data again extracted from my .ssh directory.
  4. changed owner to apache with 700 perms on directory an all sub-files
  5. modified the code so it now looks like this
my %params = ( protocol => "2", debug => "true", use_pty => 0, interac +tive => "false", identity_files => ("/var/www/localhost/htdocs/switch +db/.ssh/identity") );
I am now getting further in my code but get the following:
Starting run_pna_switch.pl processing request for pna_swid 17 and mode on processing request for pna_swid 17 and mode on entering Net:SSH:Perl->new command entering SSH->login command The authenticity of host '146.6.167.199' can't be established. Key fingerprint is 99:80:ac:53:50:14:5f:9a:04:ce:5f:44:0f:5c:7d:39. Are you sure you want to continue connecting (yes/no)? [yes]

So, of course I tried to run the code as 'su - apache /usr/bin/perl code.pl' but it does not run and does not produce any output and does not ask me the question. I am stumped here as to why this code won't run for me as apache on the cli to get this interactive question answered.

Actually, nothing that I run as 'su - apache' works including 'su - apache ssh 1.2.3.4' to try to do this interactively from the cli.

Ed


In reply to Re^2: Net::SSH::Perl trouble from withing PHP by bfdi533
in thread Net::SSH::Perl trouble from withing PHP by bfdi533

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.