What is Telnet and what port it uses?

Telnet is an old network protocol that is used to connect to remote systems over a TCP/IP network. It connects to servers and network equipment over port 23. Let’s take a look at Telnet command usage.

Disclaimer

  1. Telnet is not a secure protocol and is thus NOT RECOMMENDED!. This is because data sent over the protocol is unencrypted and can be intercepted by hackers.
  2. Instead of using telnet, a more preferred protocol to use is SSH which is encrypted and more secure

Let’s see how you can install and use the telnet protocol.

Installing Telnet

In this section, we will walk you through the process of installing telnet in RPM and DEB systems.

Installation of Telnet in CentOS 7 / RHEL 7

To begin the installation process on the server, run the command

# yum install telnet telnet-server -y

Sample Output

What is Telnet and what port it uses?
Next, Start and enable the telnet service by issuing the command below

# systemctl start telnet.socket # systemctl enable telnet.socket

Sample Output

What is Telnet and what port it uses?
Next, allow port 23 which is the native port that telnet uses on the firewall.

# firewall-cmd --permanent --add-port=23/tcp

Finally, reload the firewall for the rule to take effect.

# firewall-cmd --reload

Sample Output

What is Telnet and what port it uses?
To verify the status of telnet run

# systemctl status telnet.socket

Sample Output

What is Telnet and what port it uses?
Telnet protocol is now ready for use. Next, we are going to create a login user.

In this example, we will create a login user for logging in using the telnet protocol.

# adduser telnetuser

Create a password for the user.

# passwd telnetuser

Specify the password and confirm. To use telnet command to log in to a server, use the syntax below.

$ telnet server-IP address

For example

$ telnet 38.76.11.19

In the black console, specify the username and password.

What is Telnet and what port it uses?
To login using putty, enter the server’s IP address and click on the ‘Telnet’ radio button as shown.
What is Telnet and what port it uses?
Finally, click on the ‘Open’ button. On the console screen, provide the username and password of the user
What is Telnet and what port it uses?

Installation of Telnet in Ubuntu 18.04

To install telnet protocol in Ubuntu 18.04 execute:

$ sudo apt install telnetd -y

Sample Output

What is Telnet and what port it uses?
To check whether telnet service is running, execute the command.

$ systemctl status inetd

Sample Output

What is Telnet and what port it uses?
Next, we need to open port 23 in ufw firewall.

$ ufw allow 23/tcp

Sample Output

What is Telnet and what port it uses?
Finally, reload the firewall to effect the changes.

$ ufw reload

What is Telnet and what port it uses?
Telnet has been successfully installed and ready for use. Like in the previous example in CentOS 7, you need to create a login user and log in using the same syntax.

Using telnet to check for open ports

Telnet can also be used to check if a specific port is open on a server. To do so, use the syntax below.

$ telnet server-IP port

For example, to check if port 22 is open on a server, run

$ telnet 38.76.11.19 22

Sample Output

What is Telnet and what port it uses?

This tutorial is an educational guide that shows you how to use telnet protocol. We HIGHLY DISCOURAGE the use of telnet due to the high-security risks it poses due to lack of encryption. SSH is the recommended protocol when connecting to remote systems. The data sent over SSH is encrypted and kept safe from hackers.

What is Telnet and what port it uses?

Telnet, developed in 1969, is a protocol that provides a command line interface for communication with a remote device or server, sometimes employed for remote management but also for initial device setup like network hardware. Telnet stands for Teletype Network, but it can also be used as a verb; 'to telnet' is to establish a connection using the Telnet protocol.

Telnet provides users with a bidirectional interactive text-oriented communication system utilizing a virtual terminal connection over 8 byte. User data is interspersed in-band with telnet control information over the transmission control protocol (TCP). Often, Telnet was used on a terminal to execute functions remotely.

The user connects to the server by using the Telnet protocol, which means entering Telnet into a command prompt by following this syntax: telnet hostname port. The user then executes commands on the server by using specific Telnet commands into the Telnet prompt. To end a session and log off, the user ends a Telnet command with Telnet.

Telnet can be used to test or troubleshoot remote web or mail servers, as well as for remote access to MUDs (multi-user dungeon games) and trusted internal networks.

This page mentions TELNET Port Number. The port numbers of protocols such as TELNET, FTP, DHCP, HTTP, SMTP etc. are defined as per RFC 1700.

What is Port Number ?

The end point of a logical connection is known as port. Port number is logical address of each application or process or program which uses network or internet connection in order to communicate. In TCP/IP network, it helps sender and receiver to communicate with each other. Port number is 16 bit in size which takes any value from 0 to 65536. The port numbers from 0 to 1024 are known as well known ports and are used for specialized services or privileged services. TELNET port number is 23.

IP address and port number are used to deliver data packets to its destination device. IP address resembles to apartment building or flat building housing multiple flats/apartments. The port number resembles to individual apartment or flat number. IP address/port number can be written as 192.168.1.68:8080 where in first four digits are IP address and last digit "8080" is port number.

What is TELNET Protocol?

What is Telnet and what port it uses?

• Telnet allows users to connect and log on to any other hosts in the network from their computer by using login credentials (user name, password). • Telnet uses TCP protocol for connections. • Telnet service is available on port 23 of the host machine. • Telnet client acts as terminal which accepts any keystrokes from the keyboard, interpret them and display output on screen. Client on the computer makes TCP connection to port 23 of the host machine where Telnet server answers. Telnet server interacts with applications in the host machine and assists in terminal emulation process.

• Refer advantages and disadvantages of TELNET protocol >> for more information.

Table of port numbers vs Protocols

Port numbers are pre-assigned by IANA (Internet Assigned Numbers Authority). They are specified in RFC 1700. Following table mentions port numbers for FTP, TELNET, HTTP, SMTP, POP3, IMAP, BIOS, SSH, DHCP protocols. These protocols are used in TCP or UDP connections in computer networks.


Port Number Protocol description
20, 21 port number 20 is used for FTP data while port number 21 is used for FTP Control
23 Used for TELNET
80, 8080 HTTP
443 HTTPS
161 SMTP (Simple Mail Transfer Protocol)
110 POP3
143 IMAP i.e. Interim Mail Access Protocol
137, 138, 139 port number 137 is used for BIOS Name service, 138 for NetBIOS-dgm, 139 for NetBIOS Datagram service
22 Used for SSH remote login protocol, SSH is short form of Secure Shell
67, 68 The port number 68 is used for DHCP client and 67 is used for DHCP server
53 DNS (Domain Name System)
69 TFTP (Trivial File Transfer Protocol)
70 Gopher services
79 Finger
161 SNMP
179 BGP (Border Gateway Protocol)
389 LDAP (Lightweight Directory Access Protocol)
5800, 5900 VNC


Basics of OSI and TCPIP layers
ARP Request and ARP Response
TCP IP packet format
Networking Gateway
What is Router
What is an IP address
network switch
network bridge
Hub and Types of Hub
What is MAC address

What is Difference between

hub Vs switch  circuit switching Vs packet switching  firewall Vs router  HDLC Vs PPP  IGRP Vs EIGRP  router Vs bridge  switch Vs router  WLAN Vs Ethernet LAN  LAN vs WAN vs MAN 

RF and Wireless Terminologies