Ozer
Ozer

Reputation: 1255

How to send and get data to/from SSH Tunnel in java (jsch )?

I am a begginer to SSH Tunnels and I am trying to find a way to implement an SSH tunnel between host and server and through this tunnel, I want to send and get datas. I have searched on the net and I have seen that " jsch " can help me to implement a tunnel. The problem is since there was not enough comments on http://www.jcraft.com/jsch/examples/ I could not understand how to do it. If one of you knows about how to do it, can you please explain me ? Or if you have a little piece of code, can you please put with some comments ?

Thank you very much all

Upvotes: 3

Views: 1997

Answers (1)

Cerber
Cerber

Reputation: 2939

Why do you want to do it in java ?

You'd better create a dynamic tunnel with ssh/PuTTY and use it in java thus ignoring the SSH complexity in your java code...

A dynamic tunnel is no more no less than a SOCKS 5 proxy which can easily be dealt with Java networking and Proxy + ProxySelector objects

Upvotes: 2

Related Questions