This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes jsch, trying to open tunnel and connect sftp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "jsch, trying to open tunnel and connect sftp" Watch "jsch, trying to open tunnel and connect sftp" New topic
Author

jsch, trying to open tunnel and connect sftp

Ricardo Aponte
Greenhorn

Joined: Nov 18, 2011
Posts: 1
Hi, first time poster, but I've used this site quite often.

Now here is the situation I'm in. I'm trying to figure out how to open a tunnel and then open an sftp connection through that tunnel with jsch.

Here is what I've been able to do(Sorry if it is ugly, been just messing with it trying to get it to work):

Fields, Main Method(can skip):


Local File Retrieval(can skip):


Delete Local File(can skip):


Opens Tunnel(works):

Opens connection for sftp to tunnel(not working):

Close connections(can skip):

Send file(can skip):

Grab File(can skip):

Testing to check current remote directory(can skip):

Open/close SFTP channel

Getters and Setters

Prints out for debug(can skip):

Impl for UserInfo(can skip):


Creating the tunnel works, and if I just do a straight sftp connection without the tunnel it works as well. Just trying to combine the two now. Sorry if I posted too much code, figured if it was all there and I missed something someone would point it out.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsch, trying to open tunnel and connect sftp
 
Similar Threads
Retrieve files from a remote system
File Upload Error - Using JSCH/SFTP
Applet to upload files with SCP to
com.jcraft.jsch.JSchException: connection is closed by foreign host
Error : java.net.ConnectException: Connection refused