Setting Up a Telnet Server in Ubuntu

Sponsored Link
A terminal emulation program for TCP/IP networks such as the Internet. The Telnet program runs on your computer and connects your PC to a server on the network. You can then enter commands through the Telnet program and they will be executed as if you were entering them directly on the server console. This enables you to control the server and communicate with other servers on the network. To start a Telnet session, you must log in to a server by entering a valid username and password. Telnet is a common way to remotely control Web servers.

Install Telnet Server in Ubuntu

You will find the Telnet server installation packages in Synaptic under the telnetd package.If you want to install telnet server package you can also use the following command

sudo apt-get install telnetd

This will complete the installation.Now you Restart inetd service using the following command

sudo /etc/init.d/inetd restart

Once installed, select Administration, Services and enable Telnet

you can now fire up your other Linux box and type telnet . You are prompted to enter your username and password. The whole conversation should look like this

telnet 192.168.0.1
Trying 192.168.0.1…
Connected to 192.168.0.1 (192.168.0.1)
Escape character is ‘^]'.
Welcome to telnetserver
Running Ubuntu LAMP server

* All access is logged *

login: admin12
Password:
Last login: Sat Dec 25 1:05:1 from 192.168.0.1
[admin12@telnetserver ~]$

If you are using windows machine you can download telnet clients if you like like putty and teraterm to connect.

Note that the server responds with Welcome to telnetserver, running Ubuntu LAMP server, which is a customized message. Your machine will probably respond with Ubuntu and some version information. This is insecure: giving away version numbers is never a smart move. In fact, even saying Ubuntu is questionable. Edit the issue and issue.net files in your /etc directory to change these messages.

Running the w command now shows you as connecting from the external IP address.

Telnet is fast but also insecure. It sends all your text, including your password, in plain text that can be read by anyone with the right tools. SSH, on the other hand, encrypts all your communication and so is more resource-intensive but secureeven a government security agency sniffing your packets for some reason would still have a hard time cracking the encryption.If you are looking for SSH server configuration in ubuntu check here

Sponsored Link

You may also like...

28 Responses

  1. A says:

    Thanks for the nice and simple guide…

    A little note that might help a newbie (like me). It seems that inetd is not installed by default on Ubuntu. At least that was the case with me on Edgy. I had to install the netkit-inetd package (standard shipped with Ubuntu) and this installed the standard inetd components.

  2. B says:

    Here is the correct way to set up a telnet server:

    DON’T.

    Use SSH. There are clients for every platform

  3. Graham says:

    I also needed to install the netkit-inetd package to get the telnet server to work. I’m using Dapper LTS.

  4. frank says:

    you know, sometimes telnetd is needed period. yes, we all know that it old, but like i said…sometimes it’s needed and one doesn’t always have a choice…dig?

    don’t listen to what B is trying to tell you. he’s a noob no doubt.

  5. harry says:

    hey could someone help ?

    I tried to Restart inetd service but am getting this error

    -bash: /etc/init.d/inetd: No such file or directory

  6. Deiussum says:

    As insecure as it is, sometimes Telnet is needed. For instance, my workplace firewall blocks outgoing traffic on port 22 and only has basic ports open for Telnet, FTP, and HTTP. It’s a dumb blocking rule, but they won’t open it.

    If you only need telnet access from certain IPs like I do, you can lock it down some by using /etc/hosts.deny and /etc/hosts.allow.

  7. Abeer says:

    On Ubuntu 7.10 I found we have to install inetutils-inetd and do /etc/init.d/inetutils-inetd restart. Rest of the steps still hold.

  8. Lone Wolf says:

    Eek !! Telnet. Do not use it.

    * @Deiussum : the port 22 is blocked by the firewall ? Use SSH on the Telnet port.
    * You need a SSH client for Windows ? I can think of two softwares :
    – PuTTY : A SSH client : http://www.chiark.greenend.org.uk/%7Esgtatham/putty/
    – WinSCP : A SCP client (for file transfers using SSH) : http://winscp.net/eng/docs/lang:fr

  9. Skavenger says:

    I’m just going to reinforce that on some occasions there is no other choice but to use telnet. For example I need it becuase my work uses Win XP and AD and prevents all unathorised .exe and installations so all I can use is hyperterminal. Which does not connect to SSH.

  10. john says:

    there is a type-o above.
    sudo /etc/init.d/inetd restart
    should read (on 8.04 anyway)
    sudo /etc/init.d/openbsd-inetd restart

  11. BrewBert says:

    What are the caveats if I restrict telnetd to an openvpn tun adapter? I think using ssh over a trusted vpn is overkill …efficiency-wise.

  12. jeff domique says:

    thanks!

  13. Dennis H says:

    This doesn’t work for Ubuntu 9.10. The Restart fails because there is no inetd.conf file. I found one on the web from somewhere and copied it there, but it still doesn’t work. Right now, the best I have been able to do is get telnet to respond and immediately close the connection.

    I’ve been working on this all day. So far, no mater what I do, I can’t get this thing to work.

    They really should have some sort of setup wizard for these common servers.

  14. Dennis H says:

    UPDATE: I uninstalled both telnet daemons and then reinstalled just the telnetd service. It seems to work fine now. Before, when I typed “inetd” on the command line, it told me that I needed to run “sudo apt-get install openbsd-inetd” which I did. That didn’t work, but apparently it causes trouble for the telnetd service.

  15. oz log says:

    thank’s for this article, so helpfull for beginer like me.

  16. Agung says:

    I’m using Ubuntu 9.10 server. I install telnetd, yet I can’t find /etc/init.d/inetd files.So I can’t restart telnet server. It seems that Ubuntu has installed telnet server named openbsd-inetd on my computer. It seems that you can’t have two telnet server (inetd and openbsd-inetd) on same computer. Now i’m using openbsd-inetd as my telnet server.

  17. Rohhie says:

    Easy, Easy, Easy! OpenSSH is overkill for a private LAN. Glad I found this page! Using Server version 10.04, cannot logon as root. Any ideas?

  18. ralf says:

    @Rohhie: It seems that by default login as root is denied. The documentation recommends to login as ‘you’ and perform any commands you need to run as root using the sudo command (e.g.: sudo apt-get update).

  19. srinivas says:

    how to install media players like vlc,gom players.these are not in packages

  20. Just do sudo apt-get install telnetd

    and open telnet with 127.0.0.1 ip

    you will be asked for username & password…

  21. Rajeev says:

    while trying this command : sudo /etc/init.d/openbsd-inetd restart
    I got this message:
    * Restarting internet superserver inetd
    * Not starting internet superserver: no services enabled

    However I have installed the telnetd successfully by using this command:
    sudo apt-get install inetutils-telnetd

  22. Jim (JR) says:

    First:
    Anyone that says Telnet is BOOOOOGUS is himself bogus. . . Making blanket statements is the fast boat to painting yourself into a corner.

    Likewise, people say to ONLY use sudo and never actually su to root.

    IMHO, if you are doing some serious configuration – either in Desktop or Server – you can get carpel-tunnel by typing “sudo” all day long, or just su to root, and get it over with.

    Second:
    I would greatly *recommend* trying to use SSH instead of naked telnet.

    (a) The experience gained by setting something like this up is invaluable – especially if somewhere down the road you end up needing to access your box from outside your network. (Or give someone else access to it, etc.)

    (b) There are, indeed, serious security implications to using naked Telnet, and you need to be very aware of them. Of course there are serious implications to running as root, or even sudo’ing to root. So long as you are aware of what you’re doing, and are careful, you should not get hurt.

    All that being said, (again IMHO), if you are on a private network, behind a reasonably configured hardware firewall (router), and are *NOT* doing all this over WiFi – then I would say go ahead and have fun.

    Just remember, it’s a lot like going out for a walk and leaving the front-door unlocked. You might be lucky, then again, you might not be lucky either.

    Just my two centavos.

    Jim (JR)

  23. Ma Kai says:

    It seems to be nice to be a besserwisser. But there are cases where nothing else – I emphasize – nothing else is possible than having a proper telnet daemon.

    It is bad to use telnet, that is clear. And I will definitely remove it from inetd.conf immediately when case closed. But if there are no other options …

  24. marshal says:

    how to change default port telnet ubuntu???

  25. dinesh says:

    i also got this error but then also its working

  26. S says:

    try with ” /etc/init.d/xinetd restart”.

  27. Tom "Rasputin" Orsi says:

    Bitches moved inetd to /usr/sbin on my ubuntu 15.10 server install. fyi.

Leave a Reply

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