PHP ssh2_auth_password身份验证失败


Php ssh2_auth_password authentication failed

我的php脚本生成一个excel文件,我希望这个文件在我们的文件服务器上传输,这与Web文件不同。

我正在使用 ssh2_auth_password() 函数,但我被Warning: ssh2_auth_password() [function.ssh2-auth-password]: Authentication failed for root using password消息卡住了。

大多数情况下,此问题是通过更改sshd_config文件上的行PasswordAuthentication yes来解决的。这是由函数 ssh2_auth_none() 完成并确认的,该函数返回一个包含以下内容的数组:"0:公钥,1:密码,2:键盘交互"

当我通过腻子(键入 scp /srv/www/htdocs/**** root@192.168.168.1:/***/*** )执行操作并给出密码时,它可以工作。

有什么想法吗?

最后,我只需要删除ssh2_auth_none(),它就可以了!