Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My system is Ubuntu 11

Before I typed "telnet localhost" or "telnet localhost 23". I have make this work below:

$sudo apt-get install xinetd
$vim /etc/xinetd.conf

defaults{
  instances = 60  
  log_type = SYSLOG authpriv  
  log_on_success = HOST PID  
  log_on_failure = HOST 
  cps = 25 30
}
includedir /etc/xinetd.d

$vim /etc/xinetd.d/telnet

service telnet
{
disable = no
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID}

 $sudo /etc/init.d/xinetd restart

then I type

telnet localhost


~$ telnet localhost
Trying ::1...
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
share|improve this question

migrated from stackoverflow.com Jul 3 '11 at 12:46

This question came from our site for professional and enthusiast programmers.

First of all, don't use telnet. (Use ssh.)

Second, xinetd is very picky about its configuration files. It's likely that it chokes on log_on_failure += USERID} – the closing brace must be on a line of its own. It could also be that xinetd doesn't enable the service because you don't have a /usr/sbin/in.telnetd installed. Check /var/log/syslog for any xinetd-related error messages.

share|improve this answer
    
+1, Agreed. Do not use telnet. – Kyle Smith Jul 3 '11 at 13:58
    
Another +1 from me – Linker3000 Jul 3 '11 at 15:41
    
Sometimes telnet is unavoidable or the correct tool. For example, many mail web-interfaces talk to the mail server and related databii over telnet, and simple debugging of mail issues is more difficult or impossible over ssh. – SamGoody Jul 10 '13 at 8:46
    
@SamGoody: They talk to the mail server over TCP, and the protocols happen to be text-only and thus easily usable over a telnet client. They do not connect to a telnet daemon, however, which is what OP is trying to set up. (What on earth is 'databii'?) – grawity Jul 10 '13 at 8:58
    
@grawity - thanks, I just learned (technically: learnt) something new. Ten years ago, when I began programming [dinosaur alert], a language fanatic convinced me that the plural of database is databi. Of course, there are plenty of other options: ign.com/boards/threads/whats-the-plural-of-database.250263721 :) – SamGoody Jul 10 '13 at 11:16

You must log in to answer this question.