File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes connecting to Unix Remote server using SSH Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "connecting to Unix Remote server using SSH" Watch "connecting to Unix Remote server using SSH" New topic
Author

connecting to Unix Remote server using SSH

Amar Naik
Ranch Hand

Joined: Sep 26, 2003
Posts: 43
Hi

i have an requirement where i need to connect to the Remote server (Unx box) using SSH. Once i have logged in i need to go to the specific directory and execute a script.

I have difficulty in how to connect to Remote Host using SSh thorugh java. Basically i need the system command to do it..CAnu please help me in this thing ..

Thank You
Amar
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
I found several references to Java libraries that support SSH and SSH2 by means of a Google search. For example:
http://www.ganymed.ethz.ch/ssh2/
Bill
Van Glass
Ranch Hand

Joined: Nov 18, 2000
Posts: 110
See the following article:

http://www.jscape.com/articles/ssh_using_java.html

In particular you may wish to look at the Ssh/SshScript and SshSession classes found in SSH Factory which allow you to write scripted ssh sessions.

http://www.jscape.com/sshfactory/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: connecting to Unix Remote server using SSH