Subject: | Requesting service shell on channel does not work with " 5.0.0.844 SSH Tectia Server" |
Hi,
I am not sure if this problem is a "5.0.0.844 SSH Tectia Server" problem or a Net-SFTP problem. This script used to work with our vendors sftp server untill they switched to the Tectia server.
Perl version : v5.8.0
SCRIPT
============
#!/usr/bin/perl
use Net::SFTP;
#Syntax
# sftpget.pl ftpuser ftppass ftpsrv sfile dfile
my %args = (ssh_args => [protocol=>2, port=>22, use_pty=>0, options=>["BatchMode yes"] ]);
$args{user} = $ARGV[0];
$args{password} = $ARGV[1];
$args{debug} = 5;
#push @{ $args{ssh_args} }, port => 22;
$sftp = Net::SFTP->new($ARGV[2],%args);
$attrs = Net::SFTP::Attributes->new();
$attrs->uid( [ 'nobody' ] );
$attrs->gid( [ 'nobody' ] );
$sftp->get($ARGV[3], $ARGV[4]);
exit $sftp->status;
ERROR
===========
[root@wfsxxxxx root]# ./sftpget.pl username "XXXXXXXXXXX" sftp.sername.com /HOME/filename.txt filename.txt
wfsxxxxxxx.westlakefinancial.com: Reading configuration data /root/.ssh/config
wfsxxxxxxx.westlakefinancial.com: Reading configuration data /etc/ssh_config
wfsxxxxxxx.westlakefinancial.com: Allocated local port 1023.
wfsxxxxxxx.westlakefinancial.com: Connecting to sftp.servername.com, port 22.
wfsxxxxxxx.westlakefinancial.com: Remote protocol version 2.0, remote software version 5.0.0.844 SSH Tectia Server
wfsxxxxxxx.westlakefinancial.com: Net::SSH::Perl Version 1.28, protocol version 2.0.
wfsxxxxxxx.westlakefinancial.com: No compat match: 5.0.0.844 SSH Tectia Server
wfsxxxxxxx.westlakefinancial.com: Connection established.
wfsxxxxxxx.westlakefinancial.com: Sent key-exchange init (KEXINIT), wait response.
wfsxxxxxxx.westlakefinancial.com: Algorithms, c->s: 3des-cbc hmac-sha1 none
wfsxxxxxxx.westlakefinancial.com: Algorithms, s->c: 3des-cbc hmac-sha1 none
wfsxxxxxxx.westlakefinancial.com: Entering Diffie-Hellman Group 1 key exchange.
wfsxxxxxxx.westlakefinancial.com: Sent DH public key, waiting for reply.
wfsxxxxxxx.westlakefinancial.com: Received host key, type 'ssh-dss'.
wfsxxxxxxx.westlakefinancial.com: Host 'sftp.banko.com' is known and matches the host key.
wfsxxxxxxx.westlakefinancial.com: Computing shared secret key.
wfsxxxxxxx.westlakefinancial.com: Verifying server signature.
wfsxxxxxxx.westlakefinancial.com: Waiting for NEWKEYS message.
wfsxxxxxxx.westlakefinancial.com: Enabling incoming encryption/MAC/compression.
wfsxxxxxxx.westlakefinancial.com: Send NEWKEYS, enable outgoing encryption/MAC/compression.
wfsxxxxxxx.westlakefinancial.com: Sending request for user-authentication service.
wfsxxxxxxx.westlakefinancial.com: Service accepted: ssh-userauth.
wfsxxxxxxx.westlakefinancial.com: Trying empty user-authentication request.
wfsxxxxxxx.westlakefinancial.com: Authentication methods that can continue: password,publickey.
wfsxxxxxxx.westlakefinancial.com: Next method to try is password.
wfsxxxxxxx.westlakefinancial.com: Trying password authentication.
wfsxxxxxxx.westlakefinancial.com: Login completed, opening dummy shell channel.
wfsxxxxxxx.westlakefinancial.com: channel 0: new [client-session]
wfsxxxxxxx.westlakefinancial.com: Requesting channel_open for channel 0.
wfsxxxxxxx.westlakefinancial.com: channel 0: open confirm rwindow 65536 rmax 4096
wfsxxxxxxx.westlakefinancial.com: Got channel open confirmation, requesting shell.
wfsxxxxxxx.westlakefinancial.com: Requesting service shell on channel 0.
wfsxxxxxxx.westlakefinancial.com: channel 1: new [client-session]
wfsxxxxxxx.westlakefinancial.com: Requesting channel_open for channel 1.
wfsxxxxxxx.westlakefinancial.com: channel 0: rcvd close
wfsxxxxxxx.westlakefinancial.com: channel 0: output open -> drain
wfsxxxxxxx.westlakefinancial.com: channel 0: input open -> closed
wfsxxxxxxx.westlakefinancial.com: channel 0: close_read
wfsxxxxxxx.westlakefinancial.com: channel 0: obuf empty
wfsxxxxxxx.westlakefinancial.com: channel 0: output drain -> closed
wfsxxxxxxx.westlakefinancial.com: channel 0: close_write
wfsxxxxxxx.westlakefinancial.com: channel 0: send close
wfsxxxxxxx.westlakefinancial.com: channel 0: full closed
wfsxxxxxxx.westlakefinancial.com: sftp: Sending SSH2_FXP_INIT
Connection closed at ./sftpget.pl line 12