Creación de un puerto reenviado dentro de un túnel SSH
Estoy tratando de usarSSH.NET para crear un tunel desdelocalhost:3306
al puerto 3306 en una máquina remota:
PrivateKeyFile file = new PrivateKeyFile(@" .. path to private key .. ");
using (var client = new SshClient(" .. remote server .. ", "ubuntu", file))
{
client.Connect();
var port = new ForwardedPortLocal(3306, "localhost", 3306);
client.AddForwardedPort(port);
port.Start();
// breakpoint set within the code here
client.Disconnect();
}
Cuando se alcanza el punto de ruptura,client.IsConnected
está regresandotrue
, perotelnet localhost 3306
no se está conectando Si creo la conexión utilizando Putty en su lugar, y configuro el mismo túnel allí, tiene éxito. ¿Qué me he perdido?