Hi all,
Does anyone know how to use ssh2_tunnel correctly?
I have a Windows server that is running a web server and a Linux server that is running the database server I want to connect to. My plan is to open an SSH tunnel between the Windows box and the Linux box so the connection is secure.
I want to use ssh2_tunnel to establish an SSH connection to the database server so I can locally connect to the database server. Here is more or less what I'm trying (keep in mind my code is on another box):
$connection ssh2_connect($remote_host, $remote_port);
if(ssh2_auth_password($connection, $username, $password))
{
if(ssh2_tunnel($connection, $remote_host, $remote_port))
mysql_connect(...)
}
Now, on the SSH server box, I get a log message saying the username and password were accepted, but immediately thereafter I get this message. Identification failed from xxx.xxx.xxx.xxx (SSH server's IP). Additionally, mysql is unable to connect to the server on localhost:3306.
How do I open a tunnel from the Windows box to the Linux box?
Walter