xorl has asked for the wisdom of the Perl Monks concerning the following question:
I have this script where I'm trying to scp a file from one box to my home box.
I think I set up the whole thing with ssh-keygen correctly. At least from a command prompt, I and do ssh remotebox and I'm logged in without ever being prompted for a password (this only works on my home box not when I'm on another box).
So my script is really simple.
use Net::SCP; my $scp = Net::SCP->new("10.33.1.75", "xorl") or die("COULD NOT SCP"); $scp->scp("/export/home/xorl/websterproject/xferlist.txt", "/tmp/webst +erproject_xfer.txt") or die("TRANSFER FAILED");
Now it always dies with "TRANSFER FAILED" /tmp/websterproject_xfer.txt is sometimes created as an empty file.
I believe the permissions are correct on xferlist.txt I can from a command prompt do scp 10.33.1.75:/export/home/xorl/websterproject/xferlist.txt /tmp/websterproject_xfer.txtand everything works fine (it never asks me for a password).
So now I'm trying to figure how do I see what exaclty is going on inside of Net::SSH. I tried running the script with -d but I was quickly over my head. It looked like to me everything was going fine and then all of a sudden kaboom it dies.
So can anyone help me figure out what the problem is and how to fix it? Do I need to spend much time with the debugger?
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do I debug a problem with Net:SSH
by injunjoel (Priest) on Nov 15, 2005 at 23:19 UTC | |
by xorl (Deacon) on Nov 16, 2005 at 13:09 UTC | |
|
Re: How do I debug a problem with Net:SSH
by dimishome (Beadle) on Nov 15, 2005 at 23:08 UTC | |
|
Net::SCP and Net::SCP::Expect in the same script
by xorl (Deacon) on Nov 16, 2005 at 13:17 UTC |