Bonjour, je ne parviens pas à exécuter de commandes à distance via Net::SSH:erl.

Voici mon code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 
#!/usr/bin/perl
 
use Net::SSH::Perl;
 
%params=(
   debug => "true");
$host='10.66.44.180';
$user="toto";
$pass='toto';
    my $ssh = Net::SSH::Perl->new($host,%params);
    $ssh->login($user, $pass);
    my($stdout,$stderr,$exit) = $ssh->cmd('ls');
    print "fin\n";
    print "$stdout\n";
 
%opts=(
       copy_perm => 'true' ,
       resume => 'auto' );
Voici, ce que j'obtiens à l'éxécution :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 
toto.fr: Reading configuration data /root/.ssh/config
toto.fr: Reading configuration data /etc/ssh_config
toto.fr: Allocated local port 1023.
toto.fr: Connecting to 10.66.44.180, port 22.
toto.fr: Remote version string: SSH-2.0-OpenSSH_2.2p1 Ericsson SSH Server for OSE, CXC1328552_R2G01
 
toto.fr: Remote protocol version 2.0, remote software version OpenSSH_2.2p1 Ericsson SSH Server for OSE, CXC1328552_R2G01
toto.fr: Net::SSH::Perl Version 1.30, protocol version 2.0.
toto.fr: Compat match: 'OpenSSH_2.2p1 Ericsson SSH Server for OSE, CXC1328552_R2G01' matches pattern '^OpenSSH[-_]2\.[012]'.
toto.fr: Connection established.
toto.fr: Sent key-exchange init (KEXINIT), wait response.
toto.fr: Algorithms, c->s: 3des-cbc hmac-sha1 none
toto.fr: Algorithms, s->c: 3des-cbc hmac-sha1 none
toto.fr: Entering Diffie-Hellman Group 1 key exchange.
toto.fr: Sent DH public key, waiting for reply.
toto.fr: Received host key, type 'ssh-dss'.
toto.fr: Host '10.66.42.100' is known and matches the host key.
toto.fr: Computing shared secret key.
toto.fr: Verifying server signature.
toto.fr: Waiting for NEWKEYS message.
toto.fr: Enabling incoming encryption/MAC/compression.
toto.fr: Send NEWKEYS, enable outgoing encryption/MAC/compression.
toto.fr: Sending request for user-authentication service.
toto.fr: Service accepted: ssh-userauth.
toto.fr: Trying empty user-authentication request.
toto.fr: Authentication methods that can continue: password.
toto.fr: Next method to try is password.
toto.fr: Trying password authentication.
toto.fr: Login completed, opening dummy shell channel.
toto.fr: channel 0: new [client-session]
toto.fr: Requesting channel_open for channel 0.
toto.fr: channel 0: open confirm rwindow 0 rmax 32768
toto.fr: Got channel open confirmation, requesting shell.
toto.fr: Requesting service shell on channel 0.
toto.fr: channel 1: new [client-session]
toto.fr: Requesting channel_open for channel 1.
toto.fr: Entering interactive session.
toto.fr: Sending command: ls
toto.fr: Requesting service exec on channel 1.
toto.fr: channel 1: open confirm rwindow 0 rmax 32768
Voila, ça bloque ici, sans jamais rien m'afficher.
Comment résoudre ce problème svp ?