aspose 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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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
JSCH : dos2unix command not working
Can't connect to ssh server using jsch or sshtools -- OpenSSL misconfiguration or coding error?
[Jsch] channel.connect works only sometimes
Invoking unix shell commands from java.
How to connect to Linux using Java code?