Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
安装Net/SSH/Perl.pm_Perl_Ssh_Perl Module_Net Ssh - Fatal编程技术网

安装Net/SSH/Perl.pm

安装Net/SSH/Perl.pm,perl,ssh,perl-module,net-ssh,Perl,Ssh,Perl Module,Net Ssh,我对使用perl编写脚本相当陌生。我正在尝试使用ssh连接到服务器并执行一些命令。我必须提供用户名和密码 当我尝试运行到目前为止的脚本时(下面列出的代码)。我得到以下错误 我假设这意味着我需要安装/make Net/SSH/Perl.pm,但是,当我按照我在网上找到的说明和教程进行操作时,没有一个是有效的 有人能帮我吗。我试过CPAN和ppm,CPAN说它找不到net::ssh::perl或该字符串的其他变体。而且ppm甚至不会运行,我在perl目录中没有看到它。非常感谢您的帮助 您可以尝试

我对使用perl编写脚本相当陌生。我正在尝试使用ssh连接到服务器并执行一些命令。我必须提供用户名和密码

当我尝试运行到目前为止的脚本时(下面列出的代码)。我得到以下错误

我假设这意味着我需要安装/make Net/SSH/Perl.pm,但是,当我按照我在网上找到的说明和教程进行操作时,没有一个是有效的

有人能帮我吗。我试过
CPAN
ppm
CPAN
说它找不到
net::ssh::perl
或该字符串的其他变体。而且
ppm
甚至不会运行,我在perl目录中没有看到它。非常感谢您的帮助



您可以尝试以下方法:

curl -L http://cpanmin.us | perl - --sudo App::cpanminus
cpanm Net::SSH::Perl
区分大小写

说明: 第1行将安装“cpanm”-安装模块最简单的方法是什么

第二行将安装模块Net::SSH::Perl,而不是尝试使用或在Unix/Linux环境中使用。它们更容易安装

为什么要使用Net::OpenSSH而不是其他perl-ssh?这是我通过
cpanm
安装后发现的:

perl -MCPAN -e 'install Net::SSH::Perl'
Net::OpenSSH与Net::SSH:::.*模块

   Why should you use Net::OpenSSH instead of any of the other Perl SSH
   clients available?

   Well, this is the perldoc writters (biased) opinion:

   Net::SSH::Perl is not well maintained nowadays (update: a new
   maintainer has stepped in so this situation could change!!!), requires
   a bunch of modules (some of them very difficult to install) to be
   acceptably efficient and has an API that is limited in some ways.

   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.

   Using Net::SSH::Expect, in general, is a bad idea. Handling interaction
   with a shell via Expect in a generic way just can not be reliably done.

   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.

   In comparison, Net::OpenSSH is a pure perl module that doesn't have any
   mandatory dependencies (obviously, besides requiring OpenSSH binaries).

只需在终端上键入cpan,然后键入:force install Net::SSH::Perl

安装将在随机的“获取”点上挂起。在他们花费大量时间的时候,我做了“ctrl+c”。安装将继续进行,并最终完成。我试着做“cpanm-Net::SSH::Perl”,它说“-bash:cpanm:command-notfound”。ThanksI认为是这样的,但是为什么它会挂在一些抓取上呢?它将在一个回迁上等待10分钟以上。请尝试检查:和/或从:+1中查找所有
::SSH
。Perl有这么多的工具,非常相似,很难知道哪一个好用什么。
perl -MCPAN -e 'install Net::SSH::Perl'
perl -MCPAN -e 'install Net::SSH::Perl'