Ubuntu – Telnet Server not starting

servertelnet

I am installing Ubuntu Server 13.10 and cant get telnet working on the server. I have installed both xinet.d & telnetd thru apt-get and restarted xinetd but nothing is started when I do a netstat -l.
In googling, the trouble I see mention of adding telnet stream tcp wait telnetd /usr/sbin/tcpd /usr/sbin/in.telnetd line to /etc/inetd.conf. I have no inetd.conf. I see that inetd has been depracated and I put the line in xinetd.conf and restarted xinetd service but still no telnet listening. Can someone advise me on what the proper settings for the telnet server and what files they should be in. Here is the content of my xinetd.conf file:

# Simple configuration file for xinetd
#
# Some defaults, and include /etc/xinetd.d/

defaults
{

# Please note that you need a log_type line to be able to use log_on_success
# and log_on_failure. The default is the following :
# log_type = SYSLOG daemon info

}

includedir /etc/xinetd.d

#:STANDARD: These are standard services.
telnet      stream  tcp nowait  telnetd /usr/sbin/tcpd  /usr/sbin/in.telnetd

Thanks

Best Answer

After installing telnetd and xinetd with command

sudo apt-get install xinetd telnetd

Create file telnet and put in /etc/xinetd.d

sudo nano /etc/xinetd.d/telnet

# default: on
# description: The telnet server serves telnet sessions; it uses
# unencrypted username/password pairs for authentication.
service telnet
{
disable = no
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
}

Restart xinetd service

sudo service xinetd restart

In xinetd.conf you have includedir /etc/xinetd.d and don't need line

telnet stream tcp nowait telnetd /usr/sbin/tcpd /usr/sbin/in.telnetd

erase it.

In telnet file you can add more option like:

only_from = 192.168.120.0/24 #Only users in 192.168.120.0 can access to
only_from = .bob.com #allow access from bob.com
no_access = 192.168.120.{101,105} #not allow access from the two IP.
Related Question