• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing Ping Command Through Telnet

 
ranua agarwal
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2906
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you consult the JavaDocs for the same ?
 
Rob Spoor
Sheriff
Pie
Posts: 20494
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
ranua agarwal
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can Mbean will be another choice?
 
Rob Spoor
Sheriff
Pie
Posts: 20494
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic