Configuration method for Telnet server under Ubuntu

  • 2020-05-14 05:48:50
  • OfStack

1. Start with the daemons in linux

There is a special daemon in the Linux system called inetd(InterNET services Daemon), which is used for Internet standard services and is usually started at system startup time. The command line gives you the inetd configuration file, which lists the services that inetd provides. If the configuration file is not given on the command line, inetd will read its configuration information from the file /etc/ inetd.conf. The primary task of inetd is to listen for requests for server processes that are not started at system initialization. It listens for requests on TCP or UDP ports associated with the services listed in the configuration file. When a request arrives at these protocol ports, inetd starts the corresponding server processes. When a request arrives at a service port managed by inetd, inetd forwards the request to a program called tcpd. tcpd determines whether to allow the service of the request based on the configuration file host. {allow, deny}. If the request is allowed, the corresponding server program (e.g., ftpd, telnet) will be started. This mechanism is also known as TCP_Wrapper.

xinetd (eXended InterNET services Daemon) provides similar functionality to inetd+tcp_wrapper, but is more powerful and secure. In the commercial systems of mainstream Linux publishers such as hongqi, xinetd has gradually replaced inetd with xinetd and provided access control, enhanced logging and resource management functions, becoming the Internet standard super daemon of Linux system. Many system services use xinetd, such as FTP, IMAP, POP and telnet. / etc services all services through their ports to access the server, by xinetd processing first, before to raise a service request, xinetd test requestor first meets specified in the configuration file access control rules, whether the current visit exceeds the specified access number at the same time, there are other rules, etc.,) specified in the configuration file check through, xinetd delivered the this request to the corresponding service to deal with, their sleep in and wait for the processing of a request.

2. Install software

1. $sudo apt-get install xinetd telnetd

2. $sudo vim /etc/ inetd. conf and add the following line:

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

3. $sudo vim /etc/ xinetd.conf and add the following:


# 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 
instances = 60 
log_type = SYSLOG authpriv 
log_on_success = HOST PID 
log_on_failure = HOST 
cps = 25 30 
} 
includedir /etc/xinetd.d 

4, $sudo vim/etc/xinetd d/telnet and add the following content:


# 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 
}

5, restart the machine or restart the network service $sudo/etc/init d/xinetd restart

6. Test whether the configuration is successful (if you can log in to Ubuntu through telent server, it will be successful)

Method 1: log in remotely using the TELNET client (putty login tool, etc.)

Method 2:XP dos(start → run →cmd), enter telnet, then open Ubuntu IP address (e.g. open 192.168.7.106)


Related articles: