Re: [JSch-users] SFTP through SSH tunneling
Status: Alpha
Brought to you by:
ymnk
From: Paul E. <Pau...@gm...> - 2011-09-16 16:02:28
|
Viet H. Phan schrieb: > Hi, > > I am using JSch to do SFTP with a partner. The partner asks me to connect to their SFTP > server through SSH tunneling: > > [...] > > My opinion is that this is unnecessary because SFTP is SSH-based already > (but the partner insists on their requirement). The reason to do this would be that now only the tunnel-server needs to be directly accessible from the public internet, not the target server. This allows them better access control, firewalling, etc. > I don't see JSch supports this. I see WinSCP supports this. > Do you think this should be supported by JSch? You can do it with JSch (and I did it, even). The simple way would be as with the command-line version: * create one Session to the tunnel server, and use one of its setPortForwardingL methods to create a tunnel. * create a second session connecting to localhost (and the local forwarded port). An advanced way would be using a SSH session as a Proxy, like shown in http://sourceforge.net/apps/mediawiki/jsch/index.php?title=ProxySSH. Paŭlo |