Perl的Net::( SSH vs SSH2 vs OpenSSH)-我应该如何比较它们? [英] Perl's Net::(SSH vs SSH2 vs OpenSSH) -- how should I compare them?

查看:121
本文介绍了Perl的Net::( SSH vs SSH2 vs OpenSSH)-我应该如何比较它们?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图通过Perl脚本在远程计算机上执行perl脚本.出现的一种选择是使用 system()函数并创建一个ssh密钥,因此不需要密码.这使我成为这个问题的焦点,另一个选择似乎是安装并运行以下perl模块之一:

除了使用的协议之外,我还应该与这些Perl模块进行比较吗?

解决方案

Net :: OpenSSH 文档具有部分介绍了每种方法的优缺点.以下是与您要问的内容有关的摘录,但文档中列出了更多内容:

Net :: SSH 只是一个包装周围任何 SSH二进制命令可在 机器.他们可能会很慢 建立新的SSH连接 每执行一次操作.

Net :: SSH2 Net :: SSH :: Perl ,但不完全是 稳定呢.可能很难 安装在某些特定的手术室上 系统及其API也受到限制, 与 Net :: SSH :: Perl 相同.

Net :: OpenSSH 界面.大多数操作是 表演方式与 Perl内置的和常见的 模块(即 IPC :: Open2 ).

但是,平台的选择可能会限制您的选择.

另一方面, Net :: OpenSSH 确实 在Windows上不起作用,甚至在 Cygwin.

当然,该列表偏向 Net :: OpenSSH ,但它给出了您将了解模块之间的主要区别.

Looking to execute a perl script on a remote machine via a Perl script. Appears one option is to use system() function and create an ssh key so the password is not required. Which leads me to the focus of this question, the other option appears to be to install and run one of these perl modules:

Besides the protocol used, what else should I be comparing with these Perl modules?

解决方案

The Net::OpenSSH documentation has a section describing the pros and cons of each. Here are some excerpts related to the ones you are asking about, but the documentation lists more:

Net::SSH is just a wrapper around any SSH binary commands available on the machine. It can be very slow as they establish a new SSH connection for every operation performed.

Net::SSH2 is much better than Net::SSH::Perl, but not completely stable yet. It can be very difficult to install on some specific operative systems and its API is also limited, in the same way as Net::SSH::Perl.

Net::OpenSSH has a very perlish interface. Most operations are performed in a fashion very similar to that of the Perl builtins and common modules (i.e. IPC::Open2).

However, choice of platform may limit your options.

On the other hand, Net::OpenSSH does not work on Windows, not even under Cygwin.

Granted, the list is biased towards Net::OpenSSH, but it gives you an idea of the major differences between the modules.

这篇关于Perl的Net::( SSH vs SSH2 vs OpenSSH)-我应该如何比较它们?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆