Operating System - HP-UX
1821245 Members
3120 Online
109632 Solutions
New Discussion юеВ

PERL - SCP failure - lost connection

 
Ratzie
Super Advisor

PERL - SCP failure - lost connection

I am trying to get a script to run successfully with SCP.
I have transferred the keys and can run scp manually without passwds. So you would think it would work...

Here is the script:
my $scp = Net::SCP->new("gordo.mts.mb.ca", "kali");
$scp->put("$cwd/callInstall-RepairSurvey_${file_date}.psv") or &error("Error with SCP to gordo: \n$scp->{errstr}");

I just get a "lost connection" error.
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor

Re: PERL - SCP failure - lost connection

Hi:

You might try 'Net::SFTP::Foreign' instead. Perhaps you will find it more robust and certainly more up-to-date.

Regards!

...JRF...
rmueller58
Valued Contributor

Re: PERL - SCP failure - lost connection

Not sure about the perl

in a shell script i use scp with the -B

scp -B user@host:/filename /localdir/localfile
Steven E. Protter
Exalted Contributor

Re: PERL - SCP failure - lost connection

Shalom,

Check the logs on the back end server. See if you are even getting a connection. Maybe openssh needs an update at that end.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ratzie
Super Advisor

Re: PERL - SCP failure - lost connection

Well, I have the script running as oracle, not a problem... Runs the script then scp's the file.

I needed to move it, so I created a new id, and have the script working up until the scp...

But, i have done the key exchange and can manually run scp kali@gordo:

And works flawless, so this is why I am puzzled as to why it fails.