This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • 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: 2907
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
Posts: 20827
68
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
Posts: 20827
68
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
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!