I am trying to build in SSH port forwarding into a .net application that I am writing.
I have tried using sharpSSH, but it requires the user to input their password every time, and I don't want that. I am going to handle storing the password.
I have downloaded Granados, but there is basically zero documentation for it. While I sift through the Granados source, does anyone know how to accomplish port forwarding with Granados or any other free SSH library for .NET?
SSH.NET LIbrary is a simple way to achieve this:
These C# alternatives are all derived from JCraft's java Jsch:
The Granados product page links to the Poderosa project which includes a PortForwarding plugin. The source code for the channel.cs and connectionmanager.cs files there appear to implement port forwarding. See this answer for a recommendation.
Nsch appears to be a hidden gem within MonoDevelop's NGit; it is mostly-automatically converted (background info) from Jsch.
Further research in Feb 2011 by Krzysztof Kowalczyk of Sumatra PDF.
Can you set up an DSA key on the SSH server remotely? That way, you could save a key for the user (do this as a one-time thing), then save the key on the server as an authorized user.
Although poorly documented - or at least the documentation eludes me - this seems to be able to handle SSH connections including file transfers and port forwarding: https://github.com/sshnet/SSH.NET
here is a method without promotiong any of theses
parameters :
(Fully-automated port forwarding) using SharpSSH(user,host,Lport,Rhost,Rport,DSA-key-confirmation,Password)