Jim
Jim

Reputation: 19552

Running commands in remote linux from java

I want to do a remote shell to a Linux system and run various commands e.g. to ps and grep for processes and kill them.
I assume I can do something like: rsh that linux scripts do right?Is this the best option for me?

Upvotes: 0

Views: 2015

Answers (2)

destiny1020
destiny1020

Reputation: 119

JSch is a good choice to do such kind of tasks.

Upvotes: 0

David Webb
David Webb

Reputation: 193696

rsh is unencrypted so isn't widely used anymore and is probably switched off on the remote systems you want to connect to.

It would be better to use SSH. JSch is a open source pure Java library that will make SSH connections and run commands for you.

Upvotes: 5

Related Questions