top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to connect to a linux machine in same network using Java?

+3 votes
712 views

I want to write a java program to connect a linux machine to check its CPU usage in every 5 minute.
I have details like ip, username and password of that particular machine.
Can anyone share a sample for this?

posted Dec 17, 2013 by Satyabrata Mahapatra

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
Try JSCH which will allow you to connect and run a script on the target.

1 Answer

+1 vote

You need to open an ssh connection to the other server from within your Java application. The OpenSSH (http://www.openssh.org/java.html) site has some useful information on libraries that will give you ssh support in Java.

Try http://www.ganymed.ethz.ch/ssh2/ also...

answer Dec 17, 2013 by Naveena Garg
Similar Questions
+2 votes

Please share a sample program with detail code.

+1 vote

Do the big Linux distributions support java when freshly installed?
If i have a Java Swing application, will it work in a freshly installed Linux with no internet connection?

I understand that there are no guarantees, but how likely is it for a Linux machine NOT to have any java/Swing support?

+4 votes

I have developed a simple Java application in eclipse (Windows) now I have to move this application to the linux (what are the steps to follow ) , can you folks help me on this?

+2 votes

There has been a lot of talk that Java is not safe (can be attacked, virus, etc.) recently, and due to the nature of some of the security problems, will never be fixed. I was told to remove Java from Firefox (not Java Script). Libre Office uses Java as part of the Base section.

Is Java going to be the 'back door' into Linux virus', attacks, etc.

...