user84592
user84592

Reputation: 4882

Java remote access a linux machine from windows machine

I have a windows machine which connects to a remote Linux machine where my Java program is running. How could I run a command for example, "free -m" in the remote linux machine and collects data in the windows machine. Any strategy?

Upvotes: 0

Views: 2026

Answers (4)

user545680
user545680

Reputation:

I have previously used Trilead SSH which was great and simple to use. Unfortunately Trilead don't support it anymore, however according to this site (lots of SSH links there) the ex-Trilead version is now here.

Upvotes: 0

Suraj Chandran
Suraj Chandran

Reputation: 24801

If you use anything except jsch, you run the risk of blasphemy :)

Upvotes: 1

Nikunj
Nikunj

Reputation: 3128

You can execute Linux command from java program remotely using Jsch and expect4j.
For example, look at this question.

Upvotes: 2

Alex Gitelman
Alex Gitelman

Reputation: 24732

You can use ssh user@host free -m. Just get some ssh client for windows. I personally prefer cygwin which will also give you a nice way to script it using bash.

Upvotes: 1

Related Questions