How do I turn on telnet service on for a Linux / FreeBSD system?

Q. Can you example how can I install telnet service or server under Linux or FreeBSD operating system?

A. TELNET (TELetype NETwork) is a network protocol used on the Internet or local area network LAN connections.

The telnetd program (telnet server) is a server which supports the DARPA telnet interactive communication protocol. Telnetd is normally invoked by the internet server inetd or xinetd for requests to connect to the telnet port as indicated by the /etc/services file. Usaually telnet listen on port TCP port 23.

Telnet in is insecure protocol and it is recommended that you use ssh server. But some time you really need telnet then first install telnet server as according to version of Linux distribution.

Telnet server installation

WARNING! Installing telnet open your computer to unencrypted network communication, which is a bad idea. If possible avoid telnet; and use secure shell called ssh.

Debain/Ubuntu Linux user type the following command:
# apt-get install telnetd
OR
$ sudo apt-get install telnetdFedora Linux user the following command:
# yum install telnet-server telnetRed Hat enterprise Linux user type the following command:
up2date telnet-server telnetFreeBSD user type the following command:
No need to install new (telnet server) package, it is installed by default (/usr/libexec/telnetd)

Configure telnet server (turn on telnet server)

Again each distribution has its own method to turn on or off telnet service; same applies to telnet UNIX/Linux server.

If you are using Red Hat / Fedora Linux
The configuration file for telnet is /etc/xinetd.d/telnet. To enable telnet server you need to open this file and make sure disable = no read as disable = yes.
Alternately,
# chkconfig telnet onTo start telnet server type command:
# /etc/init.d/xinetd restartIf you are using Debian Linux
The configuration file for telnet is /etc/inetd.conf. By default it is enabled when you install telnet server. To start telnet server type command:
# /etc/init.d/inetd restartIf you are using FreeBSD
The configuration file for telnet is /etc/inetd.conf. Open file using vi text editor and uncomment line:
# vi /etc/inetd.conf
Make sure commented line:
#telnet stream tcp nowait root /usr/libexec/telnetd telnetdRead as follows:
telnet stream tcp nowait root /usr/libexec/telnetd telnetdSave and close the file. Start telnet service:

Enable inetd service so that telnet get loaded:
# vi /etc/rc.confAppend/add following line to configuration file:
inetd_enable="YES"Save and close the file, Rsstart telnet via inetd service:
# /etc/rc.d/inetd restart

Telnet to server (How do I use telnet client?)

You should now be able to telnet to the server from Windows or Linux desktop system. Type the following command to connect to Telnet server:telnet server-ip-address
telnet 192.168.1.5

🐧 If you liked this page, please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
40 comments… add one
  • raja Mar 12, 2009 @ 9:58

    how to configure more than 100 telnet ip address
    it wiil be only connecting 40or50

  • thepul Apr 6, 2009 @ 6:05

    Your article was really helpful

  • mohammad May 26, 2009 @ 19:07

    lot of thanks

  • ankurk Aug 13, 2009 @ 11:39

    i found the aforementioned tips to be really useful…
    thank you .

  • rameshr Mar 15, 2010 @ 7:00

    hellow sir i am ramesh bigenner how to configure more than 60 telnet ip address
    it wiil be only connecting 40or50 please sent my mail address

  • Viknesh S T G M Jun 29, 2010 @ 4:53

    Thanks that was really helpful

  • Arun Jun 30, 2010 @ 10:25

    Hi i am not able to enable Telnet service in my PC even i Used sudo apt-get install telnetd command in Ubuntu 9.04, is anything i need to install in the system to enable Telnet in my PC

  • Rohit Sep 1, 2010 @ 6:01

    I got the following error while installing xinetd service

    Header V3 DSA Signature NOKEY,key ID 37017186

    Give me steps to start the telnet service on Red Hat Linux

  • thirisangu Nov 23, 2010 @ 6:55

    i was installed windows and Red Hat in bot pc how can i mount the ntfs file in my linux os

  • Mauro Gagna Feb 3, 2011 @ 15:10

    To install telnet in Debian Lenny (debian 5) yo have to do:

    apt-get install telnetd

    /etc/init.d/openbsd-inetd restart

  • Swamy Feb 18, 2011 @ 10:32

    I am a Ubuntu user, I am not able to use telnet, please let me know how it works.
    I am getting following error …
    #sudo apt-get install telnetd

    sudo] password for ubuntu:
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Unable to locate package telnetd

  • RCruz Feb 21, 2011 @ 20:11

    I have the same problem that Swamy.
    E: Unable to locate package telnetd.

    I have Ubuntu Server 10.10 in a VM over Windows with the network configured in Bridge mode.

    Please any help or direction will be welcome.

    Thanks in advance.

  • zaheeralam Mar 18, 2011 @ 8:49

    this is very user full for me

  • MUKESH KUMAR YADAV Jun 6, 2011 @ 6:26

    => Click Application > Accessories > Terminal
    => sudo bash
    => apt-get install xinetd telnetd
    => After Downloading this package
    => gedit /etc/inetd.conf
    write this syntex in this file
    Syntex = telnet stram tcp nowait telnetd /usr/sbin/tcp /usr/sbinin.telnetd
    after saving this file
    => service xinetd restart
    => gedit /etc/xinetd.d/telne
    service start
    {
    disable = no
    flags = REUSE
    socket_type = stream
    wait = no
    user = root
    server = /user/sbin/in.telnetd
    log_on_failure += USERID
    }

    => service xinetd restart
    enjoy the telnet service

  • Ryan Jul 19, 2011 @ 19:58

    people with the same problem as Swamy and RCruz:
    you actually need to do a
    sudo apt-get install inetutils-telnetd

  • subh Jul 19, 2011 @ 21:15

    can u tell me what is problem while giving my bt login and password it is not allowing to enter giving login failure

  • shabbir Aug 1, 2011 @ 16:01

    thanks for your suggestion

  • pradeep nair Sep 3, 2011 @ 12:17

    sir,
    I can connect to unix sco server through pc by using telnet but i am not able to connect it through my hcl thin clients. kindly suggest how do i connect to my unix server through telnet
    from my thin clients
    thanks a lot in advance

  • suman Sep 15, 2014 @ 23:03

    how to install in dns package in rhel6 linux plse guide step and step ?

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.