Best Regards,
Jumping Qu
------
Don't tell me how many enemies we have, but where they are!
(ADV:Perl -- It's like Java, only it lets you deliver on time and under budget.)
2009/6/16 cnhack TNT <cnhacktnt@gmail.com>
在我这里,如果远程主机不在 .ssh/known_hosts 里,用 Net::OpenSSH 的话,会提示你类似:
--------
The authenticity of host 'xxx.com (123.123.123.213)' can't be established.
DSA key fingerprint is xx:xx:d7:79:ea:aa:20:dc:24:xx:63:94:0e:26:f1:62.
Are you sure you want to continue connecting (yes/no)?
--------
回答yes即可正常
如果讨厌这个 Host key checking 的特性,如你所说加个参数即可:
--------
my $ssh = Net::OpenSSH->new("xxx.com", master_opts=>[ -o => "StrictHostKeyChecking no" ] );
--------
man ssh_config 里面有关于 StrictHostKeyChecking 的说明。
:-)2009/6/16 flw <su2admin@gmail.com>
我现在就碰到的是这个错误:($status eq 'waiting_for_password_prompt') {
error: unable to establish master SSH connection: the authenticity of the target host can't be established, try loging manually first
这是 Net::OpenSSH 里对应的那段源代码:
if
if ($$bout =~ /The authenticity of host.*can't be established/si) {
$self->_set_error(OSSH_MASTER_FAILED, $wfm_error_prefix,
"the authenticity of the target host can't be established, try loging manually first");
注意这里 =======>
$self->_kill_master;
return undef;
}
if ($$bout =~ s/^(.*:)//s) {
$debug and $debug & 4 and _debug "passwd requested ($1)";
print $mpty "$passwd\n";
$status = 'password_sent';
}
}
按照它的提示,手工登录一下(实际上就是消除了那个 yes)之后,
再用 Net::OpenSSH 登录,就好了。
难道 Net::OpenSSH 的作者认为这个提示可以通过 ssh 命令的某个选项关掉因此故意不支持的?
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---
没有评论:
发表评论