When I SSH to VMWare ESXi server, there is no problem.
sshpass -p 'my_password' ssh root@xxx.xxx.xxx.xxx
But when I try connecting via PHP script, an error appears: PHP Warning: ssh2_auth_password(): Authentication failed for root using password
. I don't see "Authentication Successful!" nor "Authentication Failed" as defined in my PHP script. I tried SSHing to a different server (non-ESXi), thePHP script works without any problems.
Here is my PHP script:
<?php
$conn = ssh2_connect('xxx.xxx.xxx.xxx', 22);
if(ssh2_auth_password ( $conn, 'root', 'my_password')) {
echo "Authentication Successful!\n";
} else {
die("Authentication Failed...");
}
?>
I don't know if there is something wrong with my code, PHP SSH library, or something with ESXi server? Please help...