我试图使用SSH1将我连接到交换机(交换机已经老了,不支持ssh2),在第一步之后,我的程序没有做什么,我必须按Ctrl + C阻止它
# Perl v5.8.8 built for MSWin32-x86-multi-thread
#!perl
use strict;
use warnings;
use Net::SSH::Perl;
my $host = "10.*.*.*";
my $username = "***";
my $password = "***";
my $cmd = 'show version';
my $ssh = Net::SSH::Perl->new($host, debug => 1);
$ssh->login($username, $password);
my($stdout, $stderr, $exit) = $ssh->cmd($cmd); #the script stops here
print $stdout;
日志:
Connecting to 10.*.*.*, port 22.
Remote version string: SSH-1.5-OpenSSH_2.9p1
Remote protocol version 1.5, remote software version OpenSSH_2.9p1
Net::SSH::Perl Version 1.42, protocol version 1.5.
No compat match: OpenSSH_2.9p1.
Connection established.
Waiting for server public key.
Received server public key (512 bits) and host key (896 bits).
Host '10.*.*.*' is known and matches the host key.
Encryption type: DES3
Sent encrypted session key.
Received encryption confirmation.
Trying password authentication.
Sending command: show version
Entering interactive session.
Terminating on signal SIGINT(2) #Ctrl-C
我可以用腻子登录,但它确实有效。
我使用过wiresharck,我们可以看到密码和登录名不是用于反对putty http://image.noelshack.com/fichiers/2016/31/1470038197-troubleshooting2-ssh1.png,数据包太亮了。 我不明白出了什么问题,连接失败的原因以及日志对此没有任何说明。
答案 0 :(得分:0)
这似乎是我的3 HP交换机(2524,5304,5130)的问题。我终于测试了一个cisco开关,它的工作完美........ 我会搜索密钥大小的解决方案或类似的东西
编辑:我现在正在使用python并遇到同样的问题,但我在这里找到了解决方案http://forums.juniper.net/t5/ScreenOS-Firewalls-NOT-SRX/Python-Paramiko-with-netscreen/m-p/294864