我有一个场景,当我打电话时ssh2_auth_none
,它会返回true
。根据文档,这似乎表明这意味着交换机被配置为允许无需身份验证即可登录。
然而,这种情况并非如此。我们正在使用密码...
这是我的代码的样子:
<?php
$connection = ssh2_connect('10.124.123.45', 22);
$auth_methods = ssh2_auth_none($connection, 'username');
var_dump($auth_methods);
if (in_array('password', $auth_methods)) {
echo "Server supports password based authentication\n";
}
?>
只是想知道您是否对我可以测试或检查什么来解决此问题有任何想法或意见。最终,我希望能够打电话ssh2_connect
并ssh2_auth_password()
登录到这个交换机。
谢谢。