我正在尝试使用 Net_SSH2 类登录 ssh 服务器,但出现错误:
注意:在第1389行的/var/www/html/includes/classes/Net/SSH2.php中找不到与客户端加密算法兼容的服务器
第 1389 行的代码是:
$decrypt = $this->_array_intersect_first($encryption_algorithms, $this->encryption_algorithms_server_to_client);
$decryptKeyLength = $this->_encryption_algorithm_to_key_size($decrypt);
if ($decryptKeyLength === null) {
user_error('No compatible server to client encryption algorithms found');
return $this->_disconnect(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
}
我用于进程的 PHP 文件:
$ssh = new Net_SSH2('192.168.111.159');
if (!$ssh->login('root', 'xxxxxxx')) {
exit('Login Failed');
}
echo $ssh->exec('pwd');
echo $ssh->exec('ls -la');
PS。-> 我也登录失败,但我的登录没问题,我在网络服务器上尝试了真正的终端,它工作正常。
问题是为什么我的数据是正确的登录失败以及如何修复错误。