1
2
3
4
5
6
7
8
9
10
#!/usr/bin/perl
use strict;
use Net::SSH2;
my $ssh2 = Net::SSH2->new();
$ssh2->connect('www.example.com', 22) or die $!;
print $ssh2->error() . "\n"; # 0
$ssh2->method('COMP_SC', 'zlib');
print $ssh2->error() . "\n"; # -33
$ssh2->disconnect();
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/usr/bin/perl use 5.008; use strict; use warnings; use Net::SSH2; # ist Version 0.45 my $ssh2 = Net::SSH2->new(); $ssh2->connect('debby', 22) or die $!; print "\n", join " ",($ssh2->error()); $ssh2->auth_password(qw(test test)); print "\n", join " ",($ssh2->error()); $ssh2->method('COMP_CS', 'zlib'); print "\n", join " ",($ssh2->error()); $ssh2->method('COMP_SC', 'zlib'); print "\n", join " ",($ssh2->error()); $ssh2->disconnect(); print "\n", join " ",($ssh2->error());
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
[test] ~ ssh -v -C test@debby
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Connecting to debby [10.0.0.17] port 22.
debug1: Connection established.
debug1: identity file ~/.ssh/identity type -1
debug1: identity file ~/.ssh/id_rsa type -1
debug1: identity file ~/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.0p1 Debian-3
debug1: match: OpenSSH_6.0p1 Debian-3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 zlib@openssh.com
debug1: kex: client->server aes128-cbc hmac-md5 zlib@openssh.com
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'debby' is known and matches the RSA host key.
debug1: Found key in ~/.ssh/known_hosts:2
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: ~/.ssh/identity
debug1: Trying private key: ~/.ssh/id_rsa
debug1: Trying private key: ~/.ssh/id_dsa
debug1: Next authentication method: password
test@debby's password:
Quote.No matching comp found: client zlib server none,zlib@openssh.com at /usr/local/share/perl/5.14.2/Net/SSH/Perl/SSH2.pm line 92.