Linux – Telnet on Linux Server

command linelinuxnetworkingtelnetwebserver

I want to know if it is necessary to have telnet enabled on both sides of machines to get telnet connection.

Here's the issue: I am trying to telnet some public IP on port 80 from a Linux web server (Red Hat).

This public IP has got HTTP (80) enabled on it. I'm not sure if telnet is enabled but the owner says it is.

On my Linux server, HTTP (80) is enabled but not telnet. Instead SSH is enabled.

When I telnet from my Linux server: telnet PublicIP 80 it says:

Trying "PublicIP"...
Connected to "PublicIP" ("PublicIP").
Escape character is '^]'.
Connection closed by foreign host

Do is have to enable telnet on my server for it to work? Because there's no issue at the other end as confirmed by other sources. Public IP: 220.226.190.180

Please explain how can I make it work. If I have to enable telnet on my Linux server, please share the command and method to do so.

Best Answer

You are trying to test connectivity to a remote Web server with telnet? Then, no: you do not need telnet servers. The remote HTTP server is waiting for commands, as indicated by the escape character. When it times out waiting, the connection is closed. So...

telnet <hostname or ip address> 80

Then type some HTTP commands:

GET / HTTP/1.1
host: <fqdn>

Use the FQDN of a host that the remote Web server has been configured to serve. It will return the default document with the HTTP commands above. Please note the accurate comment by 0xAF.

Related Question