File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Murach's Java Servlets and JSP this week in the Servlets 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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Execute a command on a remote Shell using JSCH
 
Similar Threads
Invoking unix shell commands from java.
How to connect to Linux using Java code?
[Jsch] channel.connect works only sometimes
Can't connect to ssh server using jsch or sshtools -- OpenSSL misconfiguration or coding error?
JSCH : dos2unix command not working