Reputation: 4882
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
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
Reputation: 24801
If you use anything except jsch, you run the risk of blasphemy :)
Upvotes: 1
Reputation: 3128
You can execute Linux command from java program remotely using Jsch and expect4j.
For example, look at this question.
Upvotes: 2
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