Usage of Telnet

Telnet serves numerous purposes, exemplified through practical scenarios. Let’s explore its usage through an example.

Example 1: Verifying Accessibility of an HTTP Server

Step 1: We can check the availability of any HTTP server by using the below command.

telnet www.google.com 80

This uses default port 80 to connect to Google’s Web Server:

Connect to Web Server

Step 2: Now send an HTTP request by typing the below code in the terminal.

GET / HTTP/1.1
Host: www.google.com

Send HTTP request

Step 3: We will get the response back from the Server if the connection is successful and it will include the Date, Cache-Control, Accept-Ranges, Response code, etc, and possibly the content also of the webpage.

Here we got the Status Code of 200 and the content of the homepage of www.google.com.

Response from Google’s Server

Example 2: Telnet to Test Open Ports

We can test for the open ports on a remote server using telnet. We’ll check for port 80 on a remote server

Step 1: To test the open port you have to use the IP address or hostname with the port that you want to test.

Syntax:

telnet <remote_host> <port_number>

Command:

telnet 192.168.1.100 80

Output:

Port 80 is open

And if the Port is not open then you will get a connection refused response.

Port 74 is not open

Example 3: Telnet to test a Mail Server

Step 1: Use the below syntax to use telnet to connect to the mail server.

Syntax:

telnet <mail_server_address> <port_number>

Command:

telnet localhost 25

Output:

Connecting to the mail server

Step 2: Now that the connection is successful, send the ehlo command. This command begins the SMTP session and introduces the client (you) to the server as example.com and gives back a list of supported features lists in response

Syntax:

ehlo example.com

Command:

ehlo testing.mail

Output:

ehlo command

Step 3: Now you can interact with the mail server by sending an email, checking the email queue, checking server status, troubleshoot issues, etc.

Step 4: When work is done you can exit it using the quit command.

quit

Quit mail server

How to Install and Use Telnet on Ubuntu 22.04 LTS

In Ubuntu, client-server communication involves using Telnet, a network protocol that allows you to connect to remote servers and devices over a TCP/IP network. Telnet on Ubuntu 22.04 LTS enables you to establish text-based communication with servers for various purposes such as remote administration, troubleshooting, and testing network services. In this article, we will explore the installation and usage of Telenet on Ubuntu 22.04.

Similar Reads

What is Telnet?

Telnet is a network protocol used for remote terminal access and communication over a TCP/IP network. It allows a user to log in to a remote computer or device and execute commands as if they were directly connected to that system. Telnet operates on port 23 by default and provides a text-based interface, making it suitable for tasks such as remote administration, debugging, and accessing network services. However, it’s important to note that Telnet sends data, including login credentials, in plain text, which can pose security risks, leading to its decreased usage in favor of more secure protocols like SSH (Secure Shell)....

Installation of Telnet on Ubuntu 22.04

In this section, we will see the process to install Telnet on Ubuntu 22.04. Execute the below-stated commands to install Telnet without encountering any errors....

Usage of Telnet

Telnet serves numerous purposes, exemplified through practical scenarios. Let’s explore its usage through an example....

FAQs on Install and Use Telnet on Ubuntu 22.04 LTS

Is Telnet secure?...

Conclusion

In conclusion, telnet is used to connect to a remote computer server to access it. But the disadvantage is that the communication channel is not encrypted so anyone who can access the communication channel can see all the passwords, usernames, and other important information. But still, Telnet is used in older computers. Whereas it’s still being used for Network Troubleshooting, education purposes, etc. But it’s better to look and learn its other secure alternatives like SSH....