LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Error while trying to run exec method with rsh as arguement (http://www.linuxquestions.org/questions/programming-9/error-while-trying-to-run-exec-method-with-rsh-as-arguement-267609/)

nedian123 12-18-2004 12:07 AM

Error while trying to run exec method with rsh as arguement
 
hi,
Actually i m trying to run remote shell thru java's Runtime class method exec,

Runtime t=Runtime.getRuntime();
InputStream is = t.exec("rsh 192.168.0.20").getInputStream();

If i execute any other command of linux innthis method it is easily executed i.e. result is displayed in the terminal in which it is compiled & run.
But executing rsh does'nt display anything at the terminal.

whereas if i try using ssh 192.168.0.20 as a string in the exec method above it gives the option of entering password but after entrance of password the terminal goes on thinking and does'nt log on to the remote machine.

Leave all this if i execute rsh 192.168.0.20 or ssh on the terminal it is executing perfectly after providing the password.

Kindly help me out as soon as possible....its really important.


All times are GMT -5. The time now is 11:08 AM.