–Telnet server in Linux–
Note:- This configuration properly works on Rhel4, Rhel5, Rhel6,Rhel7, centOS(5,6,7) & Fedora.
step by step procedure of telnet configuration==>
first of all we have to install .rpm package for telnet.To view telnet package in redhat package manager(rpm) use below command
#rpm -qa | grep telnet
so as you see we have two package related to telnet. now to install these packages we will use yum (yellowdog updater modified).If you don’t know how to install a package using yum then first read ==>yum server configuration in Linux
use below command to install telnet ==>
now go to telnet configuration file ==>vim /etc/xinetd.d/telnet
disable = no
>>now use esc:wq to save this file.
now we have to restart telnet service. use below commands to restart telnet service ==>
So now we successfully installed telnet service on our linux system. Now we have to do telnet on client or target PC. So let’s dive into the second part of the article==>
(how to use telnet in linux)
(telnet login as general user on client pc)
if you want to do telnet on any computer then the client pc must be in your wifi network or it must connected to your PC in LAN.
remember some important points before doing telnet on target pc–>
Let’s do Telnet on client Pc
now we are ready to do telnet on our target or client pc ==>
Step 1>> use command ==>
telnet (ip-address of client pc)
for ex. #telnet 192.168.1.110
Step2>>now you are on client pc. To check it use below commands
who am i
(how to login as root user of client pc)
we can’t login as root user on client PC because by default no extra port is open for remote connections using telnet or ssh. So we have to manually add ports on target PC .
How to add ports manually on client pc for root user login??
>On client pc go to below file==> vim /etc/securetty
(securetty file contains all the ports for login purposes)
> add pts/1, pts/2, pts/3 etc
(with the help of these additional ports we can easily login into target or client pc as root user)
>now save the file ==> esc:wq
>>thats it , now we are ready to login as root user on client pc
>Now use command ==>
telnet (ip-address of target pc)
> so now you are login on target PC as a root user. Now the target PC is in your full control, you can shutdown target pc ,add partitions and do every and each function that a root user can do on a Linux system.
How to login to a specific user using telnet service
if you know the username and ip address of a target or client pc then you can directly log in into the target pc using below command==>
#telnet -l username@ip-address
Some important help commands while doing telnet on target pc==>
how to stop or disable telnet service
>>since as we all know that telnet is not secure so its better to turn off telnet service on your PC. To turn off telnet service in red hat Linux follow below steps–>
>go to terminal and use command==> vim /etc/xinetd.d/telnet
now your telnet configuration file will open. In this file set disable = yes and save the file.
>to stop telnet service use following commands==>
#service xinetd stop
#chkconfig xinetd off
>you can also use firewall rule to block telnet
#iptables -t filter -A INPUT -s 192.168.1.0/24 -P telnet -j DROP
>use can also use tcpwrapper to block or disable telnet service.
>you can also remove telnet server package by using below command==>
#yum remove telnet-server
(Telnet is not secure)
>The one thing you must know about Telnet is that it is not a secure protocol. When you log into a remote pc using Telnet, your username and password are sent in plain text. Means they are not encrypted so if a person is using network analyzer tool in a network then by analyzing packets it will get your username and password very easily.So that’s how telnet is not secure. due to these security flaws telnet is replaced by more secure ssh protocol
configure telnet for secure remote login (secure telnet server)
now we learn how to configure telnet for secure remote login. As we know there are many security flaws in telnet but still we can configure port based security on our telnet server. So now if a user knows ip -address of your PC and want to do telnet on your secure telnet configured PC then he will be not able to login to your PC because it requires both ip -address and port to login through secure telnet server.
Secure Telnet Server Configuration
copy telnet configuration file to another file name stelnet .
#cp /etc/xinetd.d/telnet /etc/xinetd.d/stelnet
Now go to /etc/xinetd.d/stelnet and make changes in it .Now change service from telnet to stelnet, and change disable from yes to no and add port number manually to 8888.
now we have to add this port no 8888 manually to our Linux machine. Go to /etc/services file and make the entry of port.
Now simply restart the xinetd service after making above changes.
#service xinetd restart
now we will test our telnet login through the port 8888 ==>
so its clear that a user need both ip address and port to login through secure telnet. So that’s how we can add port based security to our telnet server and made it secure from unwanted attacks and hacks.
today in this article we have learned that how to configure telnet server in Linux and how to telnet through general user and root user and how to secure our Linux server by assigning port security to it.
>don’t forget to rate this article and follow us for more interesting Linux articles. please give feedback in comment section so that we will help you more and make better articles.
Stay tuned ! complete tutorial on ssh server in Linux coming soon !