APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

Enabling Linux telnet

© March 2006 Anthony Lawrence
March 2006

This has to be one of the more common support calls that I get. The telnet daemon is no longer usually installed by default, so people are surprised when their newly installed Linux system won't answer telnets.

By the way, I am always careful to explain why telnet isn't there anymore; that they probably should be thinking about ssh. But sometimes there are perfectly reasonable reasons: it's only going to be used for a few internal users, there's no path from the outside world, or their firewall is going to tightly control access. I'd still rather see them use ssh, but if they understand its weaknesses and still want to go ahead, so be it.

The first task is to install telnetd. That's the Telnet Daemon that will respond to connection requests from telnet clients. The "telnet" client is installed by default; the telntd daemon is not.

If you have a system that is connected to the internet and that has a package manager like up2date, yum or apt-get, you can use that to load this. For example, on a RedHat system, you might do "up2date telnetd" and that would go fetch the appropriate rpm, download it and install it. You still need to get it running (see below) but it's now installed.

Starting with RHEL5, RHEL no longer uses up2date; it uses yum instead.

If you don't have that ability, you need to find the software on your CD's. I'll lead you through an example from a RedHat 9 install.

We have to start by putting one of the CD's into the machine. I happen to know that what we want is on CD 3 for RedHat 9, but we're going to pretend that I have forgotten that, so I'll first insert CD 2.

Your system may mount the CD automatically. Give it a second, and type "mount". If you see /dev/cdrom in one of the output lines, you can proceed to the next step. If not, you need to mount it manually. For RedHat 9, "mount -r /dev/cdrom /mnt" will work.

Now you need to find the rpm that has telnetd. This command will search the appropriate place:

ls /mnt/RedHat/RPMS | grep telnet

If you don't have RedHat 9, you are going to have to search around for the proper drectory yourself. You can "cd /mnt" and do "ls" and continue until you find what you want. Remember, you are only looking for rpm's if you are using an rpm based system. You need to know what your OS uses.

If you can't find anything that looks like telnet (and you won't on CD 2 of RedHat 9), you have to move on to the next CD. If you have cd'd into the mounted directory, you have to cd off that before you can unmount and eject the cd. If not, you'll get "device is busy" and won't be able to remove the cd. In our sample case, we'll do:

cd /
umount /dev/cdrom

I could have also done:

cd / 
eject cdrom

Now mount the next CD and repeat your search. On RedHat 9, the grep will turn up something like "telnet-server-0.17-20.i386.rpm". I don't remember the exact numbers from the cd - the important thing is that it's "telnet-server". However, on other systems, it may not be so obvious. For example, from a RedHat ES system:

# rpm  -q --whatprovides `which telnetd`

https://www.rpmfind.net/ can sometimes help you find what you need. Once found, it needs to be installed. For the RedHat 9:

rpm -iv /mnt/RedHat/RPMS/telnet-server*

Now telnetd is installed (and "which telnetd" will show you where if you are using Bash). It's not running yet, though. For RedHat 9, do:

chkconfig telnetd on

Confirm that telnet now works by "telnet localhost" or "telnet".

However, if you installed the RedHat firewall, telnet won't be accepting outside connections, not even from your LAN. For RedHat, you can correct that by running "setup", choosing "Firewall Configuration", select "Customize", and "Allow Incoming Telnet".

Other systems have other methods for enabling telnet. Most likely, they use Xinetd. For example, it might look like one of these examples from two different systems:

root# cat /etc/xinetd.d/telnet
service telnet
        disable         = yes
        socket_type     = stream
        wait            = no
        user            = root
        server          = /usr/libexec/telnetd
        groups          = yes
        flags           = REUSE

# cat /etc/xinetd.d/krb5-telnet
# default: off
# description: The kerberized telnet server accepts normal telnet sessions, \
#              but can also use Kerberos 5 authentication.
service telnet
        disable = no
        flags           = REUSE
        socket_type     = stream        
        wait            = no
        user            = root
        server          = /usr/kerberos/sbin/telnetd
        server_args     = -n
        log_on_failure  += USERID

That's it. The details will vary, but the basic outline is find it, install it, and get it running. You really do need to think about security - not just because it's telnet, but telnet does raise more flags than other protocols and may even invite more break in attempts if it's on the internet: the fact that something responds on port 23 may be seen as weakness and cause more attention than otherwise. There are numerous articles here about general security and ssh; I really suggest you at least brush through them.

Got something to add? Send me email.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> Enabling Linux telnet


Inexpensive and informative Apple related e-books:

Take control of Apple TV, Second Edition

Take Control of Numbers

Take Control of IOS 11

Take Control of iCloud

Take Control of iCloud, Fifth Edition

More Articles by © Anthony Lawrence

Tue Nov 16 09:41:52 2010: 9115   anonymous


where is the detailed telnet commands............i am using telnet to long in to my board.........

Tue Nov 16 12:44:46 2010: 9116   TonyLawrence


"where is the detailed telnet commands" ??

Huh? I have NO clue what you are asking.

Wed Sep 5 21:45:23 2012: 11272   anonymous


How can I change the telent session emulation type to be WYSE60?

Wed Sep 5 22:07:33 2012: 11273   TonyLawrence


As asked, your question is impossible to answer. Go read (link) and pay particular attention to the area that contains
Understanding why that is so is crucial to understanding terminals. Telling a program that your terminal is ansi, or vt100, or whatever is simply informative: it's very much like telling someone that another person speaks French rather than English.


Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

Printer Friendly Version

I think it’s a new feature. Don’t tell anyone it was an accident. (Larry Wall)

Linux posts

Troubleshooting posts

This post tagged:




Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode