Link to home
Start Free TrialLog in
Avatar of huabin
huabin

asked on

Connect to a remote shell and run command in Java

Hi,

Does anyone knows how use Java code to connect to a remote shell (linx), and run some commands such as "ls"? Thanks.

Avatar of rongasa
rongasa

I would suggest to create a server/client application. The remote client would send through a socket to the server (in linux/unix) the desired command to be executed. Then the server would execute the respective code, as a normall local command.
I hope my idea help you.
ASKER CERTIFIED SOLUTION
Avatar of kjpus
kjpus

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I think his solution is better than mine...
I suggest that you follow kjpus solution, i did not this...