|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-04-13 14:47 UTC] jason at greenhell dot com
Description:
------------
For some reason, ssh2_auth_password() refuses to authenticate when connecting to localhost with ssh2_connect(). I've tried both the IP (127.0.0.1) and hostname.
Any ideas? Is this a bug?
Reproduce code:
---------------
if ($ssh = ssh2_connect("127.0.0.1")) {
if (ssh2_auth_password($ssh, "username", "password")) {
// ...
Actual result:
--------------
Warning: ssh2_auth_password(): Authentication failed for poller using password in /path/to/script.php on line XXX
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 13:00:01 2025 UTC |
same problem. connect to localhost not possible. connect to other server works. phpscript: <?php $connection = ssh2_connect('localhost', 22); if (ssh2_auth_password($connection, 'user', 'password')) { echo "Authentication Successful!\n"; } else { die('Authentication Failed...'); } print_r($connection); ?> output php script: Warning: ssh2_auth_password(): Authentication failed for ut2004 using password in /var/www/vhosts/bravo795.server4you.de/httpdocs/pages/UT2004.php on line 3 Authentication Failed... log from ssh: Jul 6 11:18:34 bravo795 sshd[22737]: Connection from ::ffff:127.0.0.1 port 56629 Jul 6 11:18:34 bravo795 sshd[22737]: debug1: Client protocol version 2.0; client software version libssh2_0.14 PHP Jul 6 11:18:34 bravo795 sshd[22737]: debug1: no match: libssh2_0.14 PHP Jul 6 11:18:34 bravo795 sshd[22737]: debug1: Enabling compatibility mode for protocol 2.0 Jul 6 11:18:34 bravo795 sshd[22737]: debug1: Local version string SSH-2.0-OpenSSH_3.8.1p1 Debian-8.sarge.4 Jul 6 11:18:34 bravo795 sshd[22737]: debug1: PAM: initializing for "ut2004" Jul 6 11:18:34 bravo795 sshd[22737]: debug1: PAM: setting PAM_RHOST to "localhost.localdomain" Jul 6 11:18:34 bravo795 sshd[22737]: debug1: PAM: setting PAM_TTY to "ssh" Jul 6 11:18:34 bravo795 sshd[22737]: debug1: do_cleanup Jul 6 11:18:35 bravo795 sshd[22737]: debug1: PAM: cleanup Jul 6 11:18:35 bravo795 sshd[22670]: debug1: Forked child 22739.