Thanks to Sisyphus I managed to get SFTP working from
Windows without any problems now. First I was confused
as to the correct port our server was listening on. When
I modified my script to use the default ftp port instead
of 2021 I was left with a different problem which I had
seen mentioned many other places. The program would hang
upon opening channel 1:

...
GHART-626-001: Sending request for user-authentication service.
GHART-626-001: Service accepted: ssh-userauth.
GHART-626-001: Trying empty user-authentication request.
GHART-626-001: Authentication methods that can continue: publickey,password.
GHART-626-001: Next method to try is publickey.
GHART-626-001: Next method to try is password.
GHART-626-001: Trying password authentication.
GHART-626-001: Login completed, opening dummy shell channel.
GHART-626-001: channel 0: new [client-session]
GHART-626-001: Requesting channel_open for channel 0.
GHART-626-001: channel 0: open confirm rwindow 100000 rmax 16384
GHART-626-001: Got channel open confirmation, requesting shell.
GHART-626-001: Requesting service shell on channel 0.
GHART-626-001: channel 1: new [client-session]
GHART-626-001: Requesting channel_open for channel 1.
GHART-626-001: Sending subsystem: sftp
GHART-626-001: Requesting service subsystem on channel 1.
GHART-626-001: channel 1: open confirm rwindow 100000 rmax 16384

[Programs stop here forever]

The key turned out to be the proper installation of all
the modules. Sisyphus referred me to the W32Perl.pm author's
website which included this tasty morsel:

"PLEASE NOTE:
The Net-SSH-W32Perl package instructs ppm to install all of the necessary
packages for it to make a SSH2 connection.  If you have installed any of the
packages manually, specifically Net::SSH::Perl (the version located here is
newer than the one on CPAN), it will probably not work.  Almost all of the
emails that I receive from people having trouble getting it to work are
resolved by removing all of the required modules and reinstalling the
Net-SSH-W32Perl package by following the directions above."

http://www.soulcage.net/ppds/

Starting with a clean perl install (5.8.7) I first installed 
Net::SSH::W32Perl and then installed Net::SFTP. I didn't need
to make any other changes, I didn't need to go into SFTP.pm
and change Perl to W32Perl or anything like that. It just all
works. It will be interesting to do a diff and see how these
new ppm-installed modules differ from the ones I was using earlier.

Thanks Sisyphus!

Arvin


> ----- Original Message -----
> From: "A. Pollock" <[EMAIL PROTECTED]>
> To: perl-win32-users@listserv.ActiveState.com
> Subject: SFTP: Can't locate object method "_session_channel"
> Date: Wed, 18 Jan 2006 15:06:24 -0500
> 
> 
> Hello,
> 
> I'm trying to transfer a file from Windows 2000 to a unix machine.
> Using Net:SFTP, debug on, I get the following error:
> 
> GHART-626-001: Reading configuration data /.ssh/config
> GHART-626-001: Reading configuration data /etc/ssh_config
> GHART-626-001: Connecting to abra.tselk.edu, port 2021.
> GHART-626-001: Socket created, turning on blocking...
> GHART-626-001: Remote protocol version ., remote software version
> GHART-626-001: Net::SSH::Perl Version 1.29, protocol version 1.5.
> GHART-626-001: No compat match: .
> GHART-626-001: Connection established.
> Can't locate object method "_session_channel" via package 
> "Net::SSH::Perl::SSH1"
>   at D:/apps/Perl/site/lib/Net/SFTP.pm line 78, <GEN0> line 1.
> 
> I have installed W32Perl.pm and changed 'use Net::SSH::W32Perl' to
> 'use Net::SSH::W32Perl' and  'my $ssh = Net::SSH::Perl->new' to
> 'my $ssh = Net::SSH::W32Perl->new' in the SFTP.pm. Line 78
> refers to this: 'my $channel = $ssh->_session_channel;' in
> sub _open_channel in SFTP.pm.
> 
> There is a warning in W32Perl.pm about Windows only supporting
> SSH2. I wonder if this has something to do with this error, seeing
> as how the error message refers to SSH1. Should I be somehow forcing
> SFTP or W32Perl to use SSH2?
> 
> I've seen many postings on the web and newsgroups about problems
> using SFTP.pm on Windows machine. I've seen plenty of solutions
> proffered but haven't actually seen anyone say they've gotten it
> to work. Has anyone gotten SFTP.pm to work on Windows?
> 
> Our server is on a sun solaris machine, the ftp software is
> proftpd-1.2.10. In the configuration file there is this line:
> TLSProtocol SSLv23, if that means anything. Here is my script:
> 
> use Net::SFTP;
> 
> my $host     = 'abra.tselk.edu';
> my $user     = 'aportlock';
> my $password = 'gatsby014';
> 
> my $sftp = Net::SFTP->new ($host,
>     'user'     => $user,
>     'password' => $password,
>     'debug'    => 1,
>     'ssh_args' => ['port' => 2021]
>       
> ) || die $@;
> 
> $sftp->put("info.txt");
> 
> 
> 
> 
> 
> --
> _______________________________________________
> 
> Search for businesses by name, location, or phone number.  -Lycos Yellow Pages
> 
> http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?SRC=lycos10
> 
> 
> _______________________________________________
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

>


-- 
_______________________________________________

Search for businesses by name, location, or phone number.  -Lycos Yellow Pages

http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?SRC=lycos10


_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to