perlfun has asked for the wisdom of the Perl Monks concerning the following question:
with password prompt. However the following perl script net_scp.pl doesn't work.scp local_file user@windows_host:/dir
The error msg is: Problem performing scp: lost connection at ./net_scp.pl line 28. The line 28 is the last line above. But the same username and password worked fine on the command line. Any help will be greatly appreciated. Thanks much.use strict; use warnings; use Net::SCP; my $file = 'xyz.txt'; my $destdir = '/dir'; my $host = 'xxx.xxx.xxx.xx'; my $user = 'user'; my $pass = 'pass'; my $scpe = Net::SCP::Expect->new(host => $host, user => $user, password => $pass) || die "Can not make connection to: $host\n"; $scpe->scp($file,$destdir) || die "can't scp: $!\n";
-----Inline Attachment Follows----- ------------------------------------------------------------------------------ RSA® Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 -----Inline Attachment Follows----- _______________________________________________ Ssh-sftp-perl-users mailing list Ssh-sftp-perl-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users Go to Previous message | Go to Next message | Back to Messages | Full Headers Reply Reply All Forward Forward Mail Search WelcomeInboxNewFoldersMail Options
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::SCP can't connect to Windows server
by Khen1950fx (Canon) on Nov 01, 2011 at 03:43 UTC | |
by ikegami (Patriarch) on Nov 01, 2011 at 05:40 UTC | |
by perlfun (Initiate) on Nov 02, 2011 at 00:09 UTC | |
by perlfun (Initiate) on Nov 01, 2011 at 18:12 UTC | |
|
Re: Net::SCP can't connect to Windows server
by Anonymous Monk on Nov 01, 2011 at 02:55 UTC |