Win a copy of Spring Boot in Practice this week in the Spring forum!
    Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

I want to login ( using Telnet ) to a Unix server

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi,

I wanted to write a Java Program which will login ( using Telnet ) to a
Unix Server ( Ex: Solaris, Red Hat Linux) and issue some commands in
the Solaris.

The Java Program should be written in Windows machine.
If the java program is executed, then commands like ps -ef should be
executed in the unix server.
 
Ranch Hand
Posts: 781
Netbeans IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Since it is insecure, most servers will not have a Telnet server running. You need to check with the target server's admin before attempting this since they get kind of upset if you seem to be trying to break into their server.

You might have more luck with SSH and for that you can use a number of libraries. My preferred SSH library is JSSH from JCraft - http://www.jcraft.com/jsch/. You can get both Telnet and SSH libraries from http://javassh.org/space/start but I have very limited experience of these products. There is also a telnet client as part of "Jakarta Commons Net"; here Google is your friend.

Again, check with the server admin before trying to connect.

 
sharjeel afzal
Greenhorn
Posts: 22
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
i write the follwing code but it just open intractive window for telnet



i want to create a telnet session from java program so that i execute commands on it like ps -ef etc
 
James Sabre
Ranch Hand
Posts: 781
Netbeans IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Once again my posts are invisible!
 
Sheriff
Posts: 22665
127
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Sharjeel, UseOneThreadPerQuestion. You've already been given advice here yesterday. Right now you've wasted some of James' time; the Apache telnet client had already been mentioned (but the links are still good).

I'm closing this thread.
 
    Bookmark Topic Watch Topic
  • New Topic