Re: [Ssh-sftp-perl-users] Device does not support shell request not preceded by pty request
Brought to you by:
dbrobins
From: DonKiShoot <don...@wa...> - 2006-11-22 14:17:04
|
Hello all, I'm trying to send some commands to my switch HP Procurve 2650 in ssh2 with Net::SSH::Perl with user 'operator' and pubkey authentification. It appears that i have a problem when starting to send command but authentification seems good. This is sample of my perl script and next debug trace with error i receive: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ foreach my $addr (keys %Switch) { # print "$addr, $Switch{$addr}{'login'} :\n"; my $ssh = Net::SSH::Perl->new($addr,'debug' => 1, 'use_pty' => 1, 'protocol' => 2, 'interactive' => 0, options => ["RhostsAuthentication no"]); #$ssh->register_handler("stdout", sub { # my($channel, $buffer) = @_; # print "I received this: ", $buffer->bytes; # }); $ssh->login($Switch{$addr}{'login'}); my($stdout, $stderr, $exit) = $ssh->cmd("\n"); print "$stdout $stderr $exit\n"; ($stdout, $stderr, $exit) = $ssh->cmd("ping $ip"); print "$stdout $stderr $exit\n"; } +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ srv78supervision: Reading configuration data /root/.ssh/config srv78supervision: Reading configuration data /etc/ssh_config srv78supervision: Allocated local port 1023. srv78supervision: Connecting to 10.1.2.22, port 22. srv78supervision: Remote version string: SSH-2.0-OpenSSH_3.7.1p2 srv78supervision: Remote protocol version 2.0, remote software version OpenSSH_3.7.1p2 srv78supervision: Net::SSH::Perl Version 1.30, protocol version 2.0. srv78supervision: No compat match: OpenSSH_3.7.1p2. srv78supervision: Connection established. srv78supervision: Sent key-exchange init (KEXINIT), wait response. srv78supervision: Algorithms, c->s: 3des-cbc hmac-sha1 none srv78supervision: Algorithms, s->c: 3des-cbc hmac-sha1 none srv78supervision: Entering Diffie-Hellman Group 1 key exchange. srv78supervision: Sent DH public key, waiting for reply. srv78supervision: Received host key, type 'ssh-rsa'. srv78supervision: Host '10.1.2.22' is known and matches the host key. srv78supervision: Computing shared secret key. srv78supervision: Verifying server signature. srv78supervision: Waiting for NEWKEYS message. srv78supervision: Enabling incoming encryption/MAC/compression. srv78supervision: Send NEWKEYS, enable outgoing encryption/MAC/compression. srv78supervision: Sending request for user-authentication service. srv78supervision: Service accepted: ssh-userauth. srv78supervision: Trying empty user-authentication request. srv78supervision: Authentication methods that can continue: publickey,password. srv78supervision: Next method to try is publickey. srv78supervision: Trying pubkey authentication with key file '/root/.ssh/id_dsa' srv78supervision: Login completed, opening dummy shell channel. srv78supervision: channel 0: new [client-session] srv78supervision: Requesting channel_open for channel 0. srv78supervision: channel 0: open confirm rwindow 0 rmax 32768 srv78supervision: Got channel open confirmation, requesting shell. srv78supervision: Requesting service shell on channel 0. srv78supervision: channel 1: new [client-session] srv78supervision: Requesting channel_open for channel 1. srv78supervision: Entering interactive session. /*Received disconnect message: Device does not support shell request not preceded by pty request. at /usr/lib/perl5/vendor_perl/5.8.8/Net/SSH/Perl/SSH2.pm line 284*/ What can i do to resolve this problem ? Thx all |