How to Fix “-bash: telnet: command not found” Error in Linux – Step-by-Step

Fix “-bash: telnet: command not found” error in Linux with this guide. Learn how to install and enable Telnet on RHEL, Ubuntu, and more.

Telnet is a communication protocol that enables two computers or servers to communicate with each other over the network. It is used to establish a connection between two computers, allowing them to exchange data and commands. Telnet is used in many different applications and scenarios, from remote access to file transfer.

telnet: command not found

Telnet is a great tool for system administrators, developers, and other tech professionals who need to access remote systems. When you want to run telnet command in linux operating system, but received “command not found” error, that’s mean the utility still not installed.

# telnet
-bash: telnet: command not found

Run the following command to install telnet in Rocky linux 7, Oracle linux 7, RHEL 7.

# yum install telnet -y

Run the following command to install telnet in Rocky linux 8, Oracle linux 8, RHEL 8.

# dnf install telnet -y

Example :

[root@rockylinux8 ~]# dnf install telnet
Last metadata expiration check: 0:38:34 ago on Sat 07 Jan 2023 05:03:15 PM +08.
Dependencies resolved.
==========================================================================================================
 Package               Architecture          Version                       Repository                Size
==========================================================================================================
Installing:
 telnet                x86_64                1:0.17-76.el8                 appstream                 71 k

Transaction Summary
==========================================================================================================
Install  1 Package

Total download size: 71 k
Installed size: 119 k
Is this ok [y/N]: y
Downloading Packages:
telnet-0.17-76.el8.x86_64.rpm                                             181 kB/s |  71 kB     00:00
----------------------------------------------------------------------------------------------------------
Total                                                                      53 kB/s |  71 kB     00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                  1/1
  Installing       : telnet-1:0.17-76.el8.x86_64                                                      1/1
  Running scriptlet: telnet-1:0.17-76.el8.x86_64                                                      1/1
  Verifying        : telnet-1:0.17-76.el8.x86_64                                                      1/1

Installed:
  telnet-1:0.17-76.el8.x86_64

Complete!

Conclusion

The “-bash: telnet: command not found” error occurs when the Telnet client is missing from your Linux system. This can be quickly resolved by installing Telnet using dnf on RHEL-based distributions or apt on Ubuntu. After installation, always verify the setup to ensure proper functionality.

See also  How to Find and Delete Files in Linux: A Step-by-Step Guide for Beginners

While Telnet can be useful for network troubleshooting, it lacks encryption and poses security risks. Whenever possible, use SSH as a more secure alternative. If Telnet is necessary, restrict its usage to trusted environments and implement security best practices.

Leave a Comment