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

by Vivek Gite · 24 comments

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

Featured Articles:

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 24 comments… read them below or add one }

1 Anonymous 06.19.06 at 9:27 pm

Thanks, man! That was really helpful! I have been looking for a telnet manual like this a long time.

2 Anonymous 06.19.06 at 11:18 pm

thank you very much ….that is help full

3 Anonymous 06.26.06 at 8:49 pm

Thanks alot

4 asghar jan 11.21.06 at 9:05 am

dear sir,
i am asghar jan from pakistan.sir i am the bigenner of linux. i need ur help with supporting docoment and speacially linux commond.
thanking you

5 Amir 12.13.06 at 11:06 am

Thanks!

6 robin 07.09.07 at 8:26 am

what should we do if there is no telnet file in redhat linux 9… and how to install the same if its not there..

7 Larry 08.10.07 at 10:28 pm

so simple… so necessary. Thanks

8 Renish Ladani 08.25.07 at 7:38 am

# chkconfig telnet on
# service xinetd reload

these both commands are useful on RHEL 4

9 Raghavendra 09.05.07 at 4:45 am

thanks alot , this document is very helpful & i am able to find solution for my prlm, thanks

10 BS 09.13.07 at 4:40 pm

Thanks a lot! I used it for Fedora 6.0.

11 lonelywolf 10.03.07 at 3:37 am

Thanks a lot!

12 Andrew Husselhof 12.26.07 at 3:43 am

Most people should be aware using telnet is *VERY* bad practice for remote administration. It’s transmission is unencrypted and is therefore very insecure. SSH is by far a more robust, offers additional features, and is by design more secure. It would be available in redhat distros via yum install sshd or debian based distro via aptitude install sshd

13 Patric Conant 12.31.07 at 5:24 pm

This is the single-most irresponsible piece of documentation I have ever seen. Without a long explanation, NEVER do this. If you are new enough to administrating a *nix (Linux, UNIX, BSD) machine that you aren’t familiar with your system’s package management system in almost all circumstances you are not qualified to start or maintain a service that publishes system credentials in plain text. Your system probably already has SSH and starts it by default.

14 john fraize 02.27.08 at 10:48 pm

FYI even the sshd is not installed as default.

Yes telnet is unsecure, but boy is it handy.
For an internal LAN in a small office, I use it.
You can use it from any PC with having to install any package.

this worked for me ubuntu 7.10
sudo apt-get install telnetd
sudo /etc/init.d/openbsd-initd restart

FYI to enagle sshd I used
sudo apt-get install openssh-server

15 Patric Conant 06.10.08 at 5:33 pm

john fraize proves my point entirely, I suppose he has reason to believe that his LAN traffic has never been analyzed, and that the Windows machine he had to re-image last week because of a virus couldn’t have possibly given anyone interested in his traffic system credentials on his Linux box, but in real-life these aren’t valid assumptions …

16 Alvare 07.12.08 at 6:31 pm

to start telnetd in my debian lenny i had to use /usr/sbin/in.telnetd , or sudo in.telnetd, after installing telnetd with apt.

17 Michael Ebbage 01.13.09 at 4:44 pm

Thanks for the guide, I got telnet installed and running on a remote server in less than 5 minutes thanks to this.

18 anilkumar 02.02.09 at 9:30 am

inredhat linux i want to telnet config

19 A.Ahmed 02.16.09 at 11:07 am

The above info is very useful… it helped me … so thanks for posting…

20 shanmuga 02.27.09 at 6:12 am

thank you for your useful configuration

21 raja 03.12.09 at 9:58 am

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

22 thepul 04.06.09 at 6:05 am

Your article was really helpful

23 mohammad 05.26.09 at 7:07 pm

lot of thanks

24 ankurk 08.13.09 at 11:39 am

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

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous FAQ:

Next FAQ:

nixCraft FAQ PDF Collection Now Available To All