I am using telnet from my command line to test connectivity to a remot host and below are the commands I used. I think I can connect to host but not able to completely understand the telnet outputs
yabhi$ telnet <remote host_ipaddr> 22
Trying <remote host_ipaddr>…
Connected to <remote host>
Escape character is '^]'.
SSH-2.0-OpenSSH_5.3
Connection closed by foreign host.
yabhi$ telnet <remote host_ipaddr> 23
Trying <remote host_ipaddr>…
telnet: connect to address <remote host_ipaddr>: Connection refused
telnet: Unable to connect to remote host
In the first command where I telnet to port 22, I get the confirmation that connection has been established to port 22(SSH port). But as I try to test any commands, like 'ping ' or 'date'(to print date), I get the connection closed error message. Does this behavior confirm if the connection has been established to remote host
Surprisingly, when I telnet to port 23(port where telnet server is running), I get the unable to connect message.