[Ssh-sftp-perl-users] Net::SFTP: problem connecting to windows server
Brought to you by:
dbrobins
From: Paul T. <pau...@te...> - 2005-10-03 21:32:29
|
I am running the test code at the bottom on a linux machine.=20 It works correctly when connecting to another linux machine.=20 When connecting to a windows machine. The connection succeeded from what = I can see=20 in the debug output but the 'ls' returns an empty list. When I do the = sftp from the linux command line: % sftp user@somehost. That sends me to the right directory and = 'ls' returns the content. A few lines from the debug output that differ from those connecting to a = linux server are enclosed too. Can anyone help? Paul. Debug output when connecting to windows server: ------- pims-dev: Remote protocol version 2.0, remote software version 1.30 = sshlib: WinSSHD 3.08 pims-dev: Net::SSH::Perl Version 1.28, protocol version 2.0. pims-dev: No compat match: 1.30 sshlib: WinSSHD 3.08 ... pims-dev: sftp: Sending SSH2_FXP_INIT pims-dev: sftp: Remote version: 2 Mon Oct 3 14:18:46 2005 SFTP connection : 0 pims-dev: sftp: Sent message T:16 I:0 Real path: / pims-dev: sftp: Sent message T:11 I:1 ls status: 0 Size: 0 Files: --------- Debug output when connecting to linux server: -------- pims-dev: Remote protocol version 1.99, remote software version = OpenSSH_3.9p1 pims-dev: Net::SSH::Perl Version 1.28, protocol version 2.0. pims-dev: No compat match: OpenSSH_3.9p1. ...... pims-dev: sftp: Sending SSH2_FXP_INIT pims-dev: sftp: Remote version: 3 Mon Oct 3 14:03:33 2005 SFTP connection : 0 pims-dev: sftp: Sent message T:16 I:0 Real path: /home/xxxx pims-dev: sftp: Sent message T:11 I:1 pims-dev: sftp: Sent message T:12 I:2 pims-dev: sftp: Received reply T:104 I:2 pims-dev: sftp: Received 100 SSH2_FXP_NAME responses pims-dev: sftp: Sent message T:12 I:3 pims-dev: sftp: Received reply T:104 I:3 pims-dev: sftp: Received 27 SSH2_FXP_NAME responses pims-dev: sftp: Sent message T:12 I:4 pims-dev: sftp: Received reply T:101 I:4 pims-dev: sftp: Received SSH2_FXP_STATUS 1 pims-dev: sftp: Sent message T:4 I:5 ls status: 0 Size: 127 Files: < long list > ----------------- #!/usr/bin/perl -w use strict; use Net::SFTP; my $host =3D "somehost"; my %args =3D ( user =3D> 'USER', password =3D> 'PASSWORD', debug =3D> 'true' ); print localtime()."\n"; my $sftp =3D Net::SFTP->new($host, %args); print localtime()."\n"; print "SFTP connection : " . $sftp->status . "\n"; my $realpath =3D $sftp->do_realpath("."); defined $realpath && print "Real path: $realpath\n" or die "do_realpath = failed\n"; my @files =3D $sftp->ls($realpath); print "ls status: " . $sftp->status . "\n"; print "Size: " . @files . "\n"; print "Files: "; foreach my $rec (@files) { print ${rec}->{filename}." "; } print "\n"; |