my dog learned polymorphism*
The moose likes Other JSE/JEE APIs and the fly likes [Jsch] channel.connect works only sometimes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "[Jsch] channel.connect works only sometimes" Watch "[Jsch] channel.connect works only sometimes" New topic
Author

[Jsch] channel.connect works only sometimes

Marco Zanini
Ranch Hand

Joined: Oct 31, 2011
Posts: 43
Hi to all, I'm trying to implement a program that connects to a remote computer using ssh, after connection I have to copy some files and execute some commands. I'm using Jsch for this purpose. The problem is that the connection with the exec channel works only sometimes. Here's the code:


I don't know if the problem is in the code or in the configuration of ssh on my own machine. It seems that the first time I run the program it works but then it does only sometimes.
I'm using linux and testing the program on my own machine (127.0.0.1).
I set the session timeout to 10000 and channel timeout to 3000.

Thanks in advance!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: [Jsch] channel.connect works only sometimes
 
Similar Threads
Execute a command on a remote Shell using JSCH
JSCH : dos2unix command not working
jcraft.jsch problem
Can't connect to ssh server using jsch or sshtools -- OpenSSL misconfiguration or coding error?
How to connect to Linux using Java code?