Hi,
I am much frustrated because near the success.. :)
I am trying to run ssh commands from a win 2k host to an Unix ssh
server, using Net::SSH::W32Perl (0.06) from active PERL.
The connection and the authentication are speed, but after the command
ssh->cmd, the ssh seems frozen, and the PC's CPU is growing up to 100%.
Then, nothing happens (during hours...).
My (simple) script is below :
#================ SCRIPT BEGINNING ==========
use Net::SSH::W32Perl;
use strict;
my $host="supervision";
my $user = "netadmin";
my $pass="XXXXX";
my %ssh_arguments = (debug=>1);
my $ssh = new Net::SSH::W32Perl($host, %ssh_arguments );
print "Step 1 \n\n";
$ssh->login($user,$pass);
print "Step 2 \n\n";
my ($out, $err, $exit) = $ssh->cmd('hostname ; exit ');
print "Step 3 \n\n";
print "Output = $out \n","Error = $err \n","Exit = $exit \n";
#================ SCRIPT END ==========
My output log is :
#================ LOG BEGINNING ==========
nanu22244: Reading configuration data /.ssh/config
nanu22244: Reading configuration data /etc/ssh_config
nanu22244: Connecting to supervision, port 22.
nanu22244: Socket created, turning on blocking...
nanu22244: Remote protocol version 2.0, remote software version Sun_SSH_1.0
Step 1
nanu22244: Net::SSH::Perl Version 1.29, protocol version 2.0.
nanu22244: No compat match: Sun_SSH_1.0.
nanu22244: Connection established.
nanu22244: Sent key-exchange init (KEXINIT), wait response.
nanu22244: Algorithms, c->s: 3des-cbc hmac-sha1 none
nanu22244: Algorithms, s->c: 3des-cbc hmac-sha1 none
nanu22244: Entering Diffie-Hellman Group 1 key exchange.
nanu22244: Sent DH public key, waiting for reply.
nanu22244: Received host key, type 'ssh-dss'.
nanu22244: Host 'supervision' is known and matches the host key.
nanu22244: Computing shared secret key.
nanu22244: Verifying server signature.
nanu22244: Waiting for NEWKEYS message.
nanu22244: Enabling incoming encryption/MAC/compression.
nanu22244: Send NEWKEYS, enable outgoing encryption/MAC/compression.
nanu22244: Sending request for user-authentication service.
nanu22244: Service accepted: ssh-userauth.
nanu22244: Trying empty user-authentication request.
Step 2
nanu22244: Authentication methods that can continue: publickey,password.
nanu22244: Next method to try is publickey.
nanu22244: Next method to try is password.
nanu22244: Trying password authentication.
nanu22244: Login completed, opening dummy shell channel.
nanu22244: channel 0: new [client-session]
nanu22244: Requesting channel_open for channel 0.
nanu22244: channel 0: open confirm rwindow 0 rmax 16384
nanu22244: Got channel open confirmation, requesting shell.
nanu22244: Requesting service shell on channel 0.
nanu22244: channel 1: new [client-session]
nanu22244: Requesting channel_open for channel 1.
nanu22244: Entering interactive session.
nanu22244: Sending command: hostname ; exit
nanu22244: Requesting service exec on channel 1.
nanu22244: channel 1: open confirm rwindow 0 rmax 16384
nanu22244: input_channel_request: rtype exit-status reply 0
#================ LOG END ==========
Each time, the ssh is blocked at the same step : "
input_channel_request: rtype exit-status reply 0".
I have tried with an other ssh server, but the behavior is the same.
I think I have installed all the modules required.
Many thanks & kind regards
Philippe
|