NewMonk2Perl has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Connecting using Net-OpenSSH with public key instead of password
by salva (Canon) on Jun 01, 2016 at 06:45 UTC | |
|
Re: Connecting using Net-OpenSSH with public key instead of password
by Lotus1 (Vicar) on May 31, 2016 at 22:19 UTC | |
|
Re: Connecting using Net-OpenSSH with public key instead of password
by talexb (Chancellor) on May 31, 2016 at 19:19 UTC | |
by NewMonk2Perl (Sexton) on May 31, 2016 at 21:40 UTC | |
by afoken (Chancellor) on Jun 01, 2016 at 06:29 UTC | |
by NewMonk2Perl (Sexton) on Jun 01, 2016 at 21:46 UTC |