Perl's Net::(SSH vs SSH2 vs OpenSSH) — how should I compare them?

前端 未结 1 1644
旧时难觅i
旧时难觅i 2021-02-20 08:26

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. Whi

相关标签:
1条回答
  • 2021-02-20 09:22

    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.

    0 讨论(0)
提交回复
热议问题