2009/2/19 Michael Zeng <[email protected]>
>
> 我有很多机器要 检测 是否能ssh 上,
> use strict ;
> use lib '/ux/prj/prjhzeng/from_cpan/lib/site_perl/5.8.9' ;
> use Net::SSH::Expect ;
>
> ### non password :
> my $ssh = Net::SSH::Expect -> new (
> host => "etiger",
> user => "prjhzeng2",
> raw_pty => 1 ,
> ) ;
>
> $ssh -> run_ssh() or die "\nError !! \n";
>
呃。。。这里 run_ssh 只是调用外部的 ssh 进程。。。所以只要 ssh 可调用,一般不会 Error 的,呵呵。
> 对于 不输入密码的, 把hostname 随便乱写, user 乱写,怎么不die 出来呢?
>
>
>
自然不会 die 的,呵呵。我把你的脚本改写了一下:
http://agentzh.org/misc/test-sshd.pl
用法是:
perl test-sshd.pl [email protected]:12345
或者不带端口的:
perl test-sshd.pl [email protected]
我自己拿我手上的各种机器都测试过了,呵呵。你可以试试哈 :)
Cheers,
-agentzh
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛“PerlChina Mongers 讨论组”论坛。
要在此论坛发帖,请发电子邮件到 [email protected]
要退订此论坛,请发邮件至 [email protected]
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---