From a servlet running in IIS under Windows, is it possible to kick off an rsh command to run a script on a remote UNIX machine?

Vincent Cirel

Just off the top of my head, the following (pseudo code) is how I'd stab at it; should point in the right direction anyway. If you want a response you'll need to create the corresponding DataInputStream.

//create a Socket object connected to port 514 (shell/cmd port used by rsh)
Socket mySock = new Socket("destination host",514);
//get the output stream for the socket
DataOutputStream outStream;
outStream = new DataOutputStream(mySock.getOutputStream());
//construct the command string
String rshStr = "whatever command you want to send"
//send it on its way
This assumes you have rsh set up on the host and you send an appropriate username with the command if required.
Hope this helps.
0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact