How To Configure Telnet Server And Telnet Client In Rhel/Centos/Fedora

In this article, we are going to discuss how to configure Telnet Server and Telnet Client in RHEL/CentOS/Fedora. Telnet is nothing but a protocol was invented in 1969 used to take remote of systems over Network in text mode or command mode as it does not support GUI (Graphical User Interface). There are two instances of Telnet i.e. Telnet Server and Telnet Client. So the concept is you can take the remote console of Telnet Server from the client using telnet tools like putty or you can use Command prompt if you are using Windows Operating System. The port number of Telnet is 23. Telnet is no doubt a useful tool but has one major disadvantage is the data transfer over the network by telnet is in non-encrypted manner i.e. in Plain Text which is Risky in case of Confidential Data.

How To Configure Telnet Server And Telnet Client In Rhel/Centos/Fedora

How To Configure Telnet Server And Telnet Client In Rhel/Centos/Fedora

So Let’s have a look at the configuration steps of Telnet Server and also Telnet Client.

Warning! : Configuring telnet is a bad idea as its transfer’s data in plain text format (unencrypted format). Try to avoid telnet as much as possible and use ssh instead.

My Scenario :

Telnet Server :

IP Address : 192.168.0.105

Telnet Server Configuration :

Follow the below steps to configure the Telnet Server:

Step: 1 Configure the IP Address

Before start, the configuration of the Telnet Server, configure the NIC (Network Interface Card) and check properly if the system is in-network. Here my IP Address is 192.168.0.105. Refer to the output below.

[[email protected] ~]# ifconfig eth0   # Check the IP Address
eth0      Link encap:Ethernet  HWaddr 00:0C:29:A4:B6:76  
          inet addr:192.168.0.105  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fea4:b676/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:70763 errors:0 dropped:0 overruns:0 frame:0
          TX packets:23211 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:69485595 (66.2 MiB)  TX bytes:1590367 (1.5 MiB)

Step: 2 Install Required Packages for Telnet Server

To start the Telnet Server configuration we need to install some packages :

telnet-server.xxx.xxx.xx.rpm
xinetd.xxx.xxx.xx.rpm

You can install the above packages by using YUM Package Repository or by rpm packages from Installation media. Here I am installing using YUM Repository. Refer to the output below.

[[email protected] ~]# yum -y install telnet-server   # Install telnet-server package
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirror.nbrc.ac.in
 * extras: mirrors.vonline.vn
 * updates: mirrors.aluhost.com
Resolving Dependencies
--> Running transaction check
---> Package telnet-server.x86_64 1:0.17-48.el6 will be installed
--> Processing Dependency: xinetd for package: 1:telnet-server-0.17-48.el6.x86_64
--> Running transaction check
---> Package xinetd.x86_64 2:2.3.14-40.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package              Arch          Version                   Repository   Size
================================================================================
Installing:
 telnet-server        x86_64        1:0.17-48.el6             base         37 k
Installing for dependencies:
 xinetd               x86_64        2:2.3.14-40.el6           base        122 k

Transaction Summary
================================================================================
Install       2 Package(s)

Total download size: 159 k
Installed size: 313 k
Downloading Packages:
(1/2): telnet-server-0.17-48.el6.x86_64.rpm              |  37 kB     00:00     
(2/2): xinetd-2.3.14-40.el6.x86_64.rpm                   | 122 kB     00:00     
--------------------------------------------------------------------------------
Total                                           305 kB/s | 159 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 2:xinetd-2.3.14-40.el6.x86_64                                1/2 
  Installing : 1:telnet-server-0.17-48.el6.x86_64                           2/2 
  Verifying  : 1:telnet-server-0.17-48.el6.x86_64                           1/2 
  Verifying  : 2:xinetd-2.3.14-40.el6.x86_64                                2/2 

Installed:
  telnet-server.x86_64 1:0.17-48.el6                                            

Dependency Installed:
  xinetd.x86_64 2:2.3.14-40.el6                                                 

Complete!

As you can see above we have installed all the required packages. To confirm the package installation use the below command.

[[email protected] ~]# rpm -qa | grep telnet-server   # Confirm telnet-server package installed or not
telnet-server-0.17-48.el6.x86_64
[[email protected] ~]# rpm -qa | grep xinetd   # Confirm xinetd package installed or not
xinetd-2.3.14-40.el6.x86_64

Now let’s check the configuration file location of Telnet Server using the rpm -ql command as shown below.

[[email protected] ~]# rpm -ql telnet-server   # Check Configuration file locations of Telnet-Server
/etc/xinetd.d/telnet
/usr/sbin/in.telnetd
/usr/share/man/man5/issue.net.5.gz
/usr/share/man/man8/in.telnetd.8.gz
/usr/share/man/man8/telnetd.8.gz

Step : 3 Configure the Telnet Server

So as shown in the output above the main configuration file of the telnet server is telnet which is located at /etc/xinetd.d/telnet, So let’s go ahead and enable telnet by edit the configuration file.

To enable the Telnet Server just edit the /etc/xinetd.d/telnet file and find for line disable = yes and change it to disable = no. Follow the output below, Configuration line is highlighted in Red color.

[[email protected] ~]# nano /etc/xinetd.d/telnet    # Configuring Telnet-Server

# default: on
# description: The telnet server serves telnet sessions; it uses \
#       unencrypted username/password pairs for authentication.
service telnet
{
        flags           = REUSE
        socket_type     = stream
        wait            = no
        user            = root
        server          = /usr/sbin/in.telnetd
        log_on_failure  += USERID
        disable         = no 
}

After configuration just saves the file and start the xinetd service to start the Telnet Server protocol by using the below command.

[[email protected] ~]# service xinetd start
Starting xinetd:                                           [  OK  ]

Now you can connect to Telnet Server using Telnet client tools like putty or if you are using Windows Operating System then can use the command prompt to connect to the telnet server and take the console of the Linux Server using normal users. For example, I have a username i.e. itsmarttricks. refer to the output below.

[[email protected] ~]# cat /etc/passwd | grep itsmarttricks
itsmarttricks:x:500:500:itsmarttricks:/home/itsmarttricks:/bin/bash

Step: 4 Allow root User Login to Telnet Server (If Required)

So here I can connect to Telnet Server by using Username as itsmarttricks and Password as Password of itsmarttricks.

Disadvantages and Security issue in Telnet :

Warning! : It’s highly recommended that you should not allow root login as there may be chances of misuse. Because of telnet transfer data in plain text format. Also, RedHat recommends that use SSH instead of telnet for security reason. But for learning purpose or on your own R & D lab you can use where security is not a matter of concern. I explained this is just for knowledge & information purpose & not to use in production server.

But if you want to login using root then you have to allow on /etc/securetty file. for that just edit the file and paste the below lines. Configuration part is highlighted in Red color.

[[email protected] ~]# nano /etc/securetty   # Allow root user to login telnet-server from Client Side

pts/0
pts/1
pts/2
pts/3
pts/4
pts/5
pts/6
pts/7
pts/8
pts/9

So we have done all required configurations from Server Side. Now restart the xinetd service to take effect the configuration.

[[email protected] ~]# service xinetd restart   # Restart the xinetd Service
Stopping xinetd:                                           [  OK  ]
Starting xinetd:                                           [  OK  ]

Then start the xinetd service on startup using the below command so that the service will start automatically when you restart the system.

[[email protected] ~]# chkconfig --level 35 xinetd on   # Start the xinetd service at Startup

Testing From Telnet Client Side :

You can use the telnet server to take the console/remote of the Linux server in text mode/Command Mode for so many purposes, eg: for configuration. To connect to the telnet server use tools like putty or in windows operating the system you can use the command prompt.

Here I am using the command prompt to connect to Telnet Server as I am using Windows Operating System.

Login Telnet Server using normal user eg: itsmarttricks. Refer to the snapshot below.

How To Configure Telnet Server And Telnet Client In Rhel/Centos/Fedora

Connecting to Telnet Server

Login Telnet Server using the root user. Refer to the snapshot below.

Note: You will only be allowed to login through root if you have added pts in /etc/securetty file, Explained above.

How To Configure Telnet Server And Telnet Client In Rhel/Centos/Fedora

connecting to the telnet server

Also Read – How to install PuTTY SSH and Telnet Client in Ubuntu

That’s all, In this article, we have explained How To Configure Telnet Server And Telnet Client In Rhel/Centos/Fedora. I hope you enjoy this article. If you like this article, then just share it. If you have any questions about this article, please comment.

Share this:

ITSmarttricks Team

This is Mangesh Dhulap the Founder and Editor of IT SMART TRICKS have 6+ years of Industrial Experience. We expect from our visitors to like, share, and comment on our posts.

You may also like...

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.