php的ssh2扩展正常安装,却无法连接目标主机

WBOY
Release: 2016-06-06 20:44:06
Original
1267 people have browsed it

<code class="lang-php">$link=ssh2_connect($host,22);
if(!$link){echo"error";}
$link1=ssh2_auth_password($link,$user,$pwd);
if(!$link1){echo"error";}
</code>
Copy after login
Copy after login

以上是我的代码,我使用的平台是lnmp,ssh2扩展已经正常安装了,因为使用ssh2_connect函数没有报错,而且我也保证了主机IP,用户名,密码都是正确的,但是还是连续输出两个error,也就是说在connect主机的时候就已经出错了,到底是哪里出错的问题,难道是ssh2所需的配套软件没装?
求解释,并讲下 ssh2正常使用需要安装什么东西(lnmp平台)

回复内容:

<code class="lang-php">$link=ssh2_connect($host,22);
if(!$link){echo"error";}
$link1=ssh2_auth_password($link,$user,$pwd);
if(!$link1){echo"error";}
</code>
Copy after login
Copy after login

以上是我的代码,我使用的平台是lnmp,ssh2扩展已经正常安装了,因为使用ssh2_connect函数没有报错,而且我也保证了主机IP,用户名,密码都是正确的,但是还是连续输出两个error,也就是说在connect主机的时候就已经出错了,到底是哪里出错的问题,难道是ssh2所需的配套软件没装?
求解释,并讲下 ssh2正常使用需要安装什么东西(lnmp平台)

求问一下lnmp平台如何安装ssh2拓展

我也有这样的问题,不知道解决了没有

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!