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
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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: 22821
132
Eclipse IDE Spring 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.
 
You don't like waffles? Well, do you like this tiny ad?
Smokeless wood heat with a rocket mass heater
https://woodheat.net
    Bookmark Topic Watch Topic
  • New Topic