I did this :
The command
using (var client = new SshClient("remote.com", "username", "password"))
{
client.Connect();
var port = new ForwardedPortLocal("localhost", 1080, "remote.com", 1080);
client.AddForwardedPort(port);
port.Exception += delegate(object sender, ExceptionEventArgs e)
{
Console.WriteLine(e.Exception.ToString());
};
port.Start();
}
Console.ReadKey();
I can send commands like if I am connected to a server in ssh (commands like ls, pwd, mkdir etc) but I can't use the tunnel as a SOCKS proxy in openvpn.The command
ssh -NfD 1080 username@remote.comworks, but not the C# application, and I don't understand why