Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Java
Expertise: Intermediate
May 4, 2005



Application Security Testing: An Integral Part of DevOps

How To Perform a Telnet Operation from a Java Application

Follow these simple steps to perform a telnet operation from a Java application:
  1. Download the free API, jta20.jar.
  2. Set the file in the classpath:
    public class TestTelnet{
      public static void main(String args[]){
            //instantiate the telnet wrapper class
            TelnetWrapper telnetWrapper = new TelnetWrapper();
            try {
                //connect to the ipaddress
                telnetWrapper.connect("192.168.0.xxx", 23);
                //username and pwd of the ipaddress
                telnetWrapper.login("username", "pwd");
                //this is the prompt appears when doing normal ftp using cmd prompt.
               //wait for the prompt
               //execute the commands
               System.out.println(telnetWrapper.send("ps -ef | grep java"));
            }catch(java.io.IOException e){

Elayaraja David
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date