Good morning Monks, I am having trouble trying to troubleshoot, trying to see if this even connects and if it connects, is it even running my command? Below is my code and the output I am getting. I am not sure what is doing at this point. I have tried 2 different secured FTP sites with their own public/private keys (both .pem & .ppk keys) with the code below and both gives me the same output information. The public key below actually does not have a password thus no paraphase given. I used WinSCP to connect using the same login info and public/private keys for both instance and I am able to connect and transfer files manually for each secured FTP sites. I do not understand what the output is trying to tell me. Any help would be greatly appreciated as usual:

#!/usr/bin/perl use strict; use warnings; use Net::OpenSSH; my $host = "10.92.xx.x"; my $user = "data"; my $key_path = 'C:\Scripts\dataops.pem'; my $port = "22"; $Net::OpenSSH::debug |= 16; my $ssh = Net::OpenSSH->new(host=>$host, user=>$user, port=>$port, #password=>$password, key_path => $key_path); $ssh->error and die "SSH connection failed: " . $ssh->error; $ssh->system("ls /usr/home/dataops") or die "remote command failed: " . $ssh->error;

Here is the output to STDOUT:

# open_ex: ['ssh','-V'] # killing SSH slave, pid: -18436 # waiting for slave, timeout: 0, remaining: 0, sleep: 0.1

In reply to Connecting using Net-OpenSSH with public key instead of password by NewMonk2Perl

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.