Installing Telnet on Centos 6.7

Before installing and using Telnet, keep the following in mind.
  • Using Telnet in public network(WAN) is very very bad idea. It transmits login data in the clear format. Everything will be sent in plain text.
  • If you still need Telnet, It is highly recommended use it in the local area network only.
  • Alternatively, you can use SSH which you will learn to install in the second post. But make sure you’ve disabled root login in SSH.

What Is Telnet?

       A network protocol that allows a user on one computer to log into another computer that is part of the same network. Once you establish a connection to the remote computer, it becomes a virtual terminal and will allow you to communicate with the remote host from your local system.

Please follow these steps to install TELNET

Open your terminal and go to super user mode by typing "su" and entering your root password and then type the following command to install telnet:
yum install telnet telnet-server -y
Now, the telnet has been installed in your server. Next, edit the telnet configuration file /etc/xinetd.d/telnet;
vi /etc/xinetd.d/telnet
Set disable = no:
# 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
}
Save and quit the file using "esc" then typing ":wq!" and pressing enter. Be mindful that you don’t have do this step in CentOS 7.
Now restart the telnet service using the following command:
On CentOS 6.x systems:
service xinetd start
Make this service to start automatically on every reboot:
On CentOS 6:
chkconfig telnet on
chkconfig xinetd on
Allow the telnet default port 23 through your firewall and Router. To allow the telnet port through firewall, go the firewall and select :
  • Other Ports and add both TCP and UDP port 23

Creating users

Create a test user, for example “nigel” with password “p@ssword“:
useradd nigel
passwd nigel 
New password: p@ssword

Client Side Configuration

Install telnet package:
yum install telnet
On DEB based systems:
sudo apt-get install telnet
Now, open Terminal, and try to access your server(remote host).
If your client is Linux system, open the terminal and type the following command to connect to telnet server.
telnet 192.168.100.2
Enter username and password which we have created in the server:
Sample output:
Trying 192.168.100.2...
Connected to 192.168.100.2.
Escape character is '^]'.
Kernel 3.10.0-123.13.2.el7.x86_64 on an x86_64
server1 login: nigel
Password: 
[nigel@dups ~]$
As you see in the above output, the remote system has been successfully accessed from the local machine.
If your client is windows system, then go to Start -> Run -> Command Prompt.
In the command prompt, type the command:
telnet 192.168.100.2
Where 192.168.100.2 is remote host IP address.
Now you will be able to connect to your server.
That’s it.
Cheers!

Comments