views:

126

answers:

4

I would like to be able to run a process that exists on a Linux machine remotely from a JAVA application running on a Windows machine. What is the best way to do this? Or an online resource that might be of help to me? Thanks very much.

A: 

In short, use an ssh client.

Option 1: Install openssh package in Cygwin.

Option 2: Use Putty.

In either case, you can setup a keypair to allow for automatic (non-password) authentication.

Steven
+4  A: 

You could use any of the many Java SSH client libraries, such as javassh, as long as the Linux machine runs an sshd (and the firewalls are all set to let ssh traffic through), which is likely to be the case. There are many possible ways to configure ssh authentication, basically boiling down to either sending password (securely) on the net, or using public/private key pairs (RSA or DSA) -- the latter is generally preferable, but you'll need to check with system and network administrators about this issue... it's not really a software development issue, but rather one related to system administration and security.

Alex Martelli
A: 
  1. Expose the process as a [fire and forget] web service on the Linux machine.
  2. Call it from the windows machine.
Pascal Thivent
A: 

You can also make a kind of client/server architecture. Your Java client will send a command to your Java server (~ webservice), that will execute the desired process. But obviously, it depends on your aims. Do you need to do that in a secure way? Is it through the internet or inside a local network? And finally, is the process a Java process?

Fred