Win a copy of Functional Reactive Programming this week in the Other Languages forum!
    Bookmark Topic Watch Topic
  • New Topic

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

 
sharjeel afzal
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • 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.
 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • 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
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
Once again my posts are invisible!
 
Rob Spoor
Sheriff
Pie
Posts: 20668
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • 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