sshnet / SSH.NET

SSH.NET is a Secure Shell (SSH) library for .NET, optimized for parallelism.
http://sshnet.github.io/SSH.NET/
MIT License
3.88k stars 917 forks source link

Reverse tunnel? #258

Open ZedZipDev opened 6 years ago

ZedZipDev commented 6 years ago

Can I create a Reverse tunnel between 2 c# applications using ssh.net if one of applications is behind of firewall?

Like this: https://github.com/eirikb/Netro

  1. A listens for incoming connections, and listens for reverse tunneling.
  2. B connects to A for tunneling.
  3. When a client connects to A the data will be transferred through the link between A and B.
  4. Connection is made on B to desired host:port.
  5. Data can now flow both ways.
Nippius commented 6 years ago

Unfortunately no. For that you need one of the applications to be an SSH server and the other one a SSH client. SSH.NET is only the client part. However, that alone is not enough because that's not how SSH works. Take a look instead to TLS and SSL sockets to secure TCP connections.