aspose file tools*
The moose likes Java in General and the fly likes Passing Ping Command Through Telnet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Passing Ping Command Through Telnet" Watch "Passing Ping Command Through Telnet" New topic
Author

Passing Ping Command Through Telnet

ranua agarwal
Greenhorn

Joined: Mar 31, 2010
Posts: 25
HI,
I am using following program to ping a remote server--


But i am getting this output :
SSH-2.0-4.1.0.34 SSH Secure Shell

Can anybody point out where is the problem?

Thanks,
Ranu.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Have you consult the JavaDocs for the same ?


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

You are using SSH (port 22) but treat it as Telnet. That's not going to work. Either switch to port 23, or use an SSH client.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
ranua agarwal
Greenhorn

Joined: Mar 31, 2010
Posts: 25
Thank you Rob for the response.
Well, i changed the port as 23, but getting exception--


As you suggested, now i am looking for SSH client. Meanwhile is there any api available that implemented this?

Thank you Sagar for showing interest in the problem.
Well, i went through java docs, but not in depth.
Anything mising?
ranua agarwal
Greenhorn

Joined: Mar 31, 2010
Posts: 25
Can Mbean will be another choice?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

ranua agarwal wrote:Thank you Rob for the response.
Well, i changed the port as 23, but getting exception--

That means that Telnet is not enabled, and SSH is your only option.

As you suggested, now i am looking for SSH client. Meanwhile is there any api available that implemented this?

java ssh
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Passing Ping Command Through Telnet