- 论坛徽章:
- 0
|
请教大家:
现在公司发布的一线运行机器,除了pl脚本,不能安装其他的东西。
我查到的ssh支持方式有如下几种
- Net::SSH::Expect => Expect ( c libary )
- Net::SSH2 => libssh2 ( c libary )
- Net::OpenSSH => IO::Tty ( c libary ) #IO-Tty 对我来说是必选 用到 open2pty 接口
- Net::SSH::Perl => Math::Gmp ( c libary ) xxxxxx
复制代码 每一个最终都依赖系统的编译器来编译东西,请教,有没有什么方式来避免安装c 模块,
并完成ssh调用呢?
或者,open2tty这个接口可以避免?
我使用如下方式调用ssh
- $ssh = Net::OpenSSH->new(
- $self->{ip}, # remote host ip
- # debug => $self->{debug},
- master_opts => [ -o => "StrictHostKeyChecking=no" ],
- %extra
- );
- ( $fh, $pid ) = $ssh->open2pty();
- # $fh->set_raw(); # you can't set this
- if ( $self->{debug} ) {
- $t = Net::Telnet->new(
- Fhopen => $fh, ....
复制代码 寻求智慧…………! |
|