This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Execute a command on a remote Shell using JSCH Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Execute a command on a remote Shell using JSCH" Watch "Execute a command on a remote Shell using JSCH" New topic
Author

Execute a command on a remote Shell using JSCH

Marco Zanini
Ranch Hand

Joined: Oct 31, 2011
Posts: 43
Hi to all, I'm trying to remotely execute a command on a Linux shell using SSH. I'm using JSCH. But sometimes when I call the connect(int timeout) command it doesn't work, and sometimes seems that it blocks.

This is the code:

How can I develop an error-proof connection?
 
jQuery in Action, 2nd edition
 
subject: Execute a command on a remote Shell using JSCH
 
Similar Threads
Invoking unix shell commands from java.
JSCH : dos2unix command not working
[Jsch] channel.connect works only sometimes
Can't connect to ssh server using jsch or sshtools -- OpenSSL misconfiguration or coding error?
How to connect to Linux using Java code?