April 27, 2013

SSH or Telnet using Java

Ever wanted to find out how one can programmatically connect to a server or a network element like router, switch, firewall etc. using SSH or Telnet – specifically if the programming language is Java? If so, then JSch and Apache Commons enable you to realize it.

SSH in Java using "JSch"

JSch can be downloaded from http://www.jcraft.com/jsch/.
Examples can be found at http://www.jcraft.com/jsch/examples/.

Telnet in Java using "Apache Commons"

Apache Commons can be downloaded from http://commons.apache.org/.
Example can be found at http://commons.apache.org/proper/commons-net/examples/telnet/TelnetClientExample.java.

No comments: