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