Problems with enabling Telnet in Ubuntu

Source: Internet
Author: User

Enable the telnet service in Ubuntu:

No, I didn't expect it to be so troublesome.

Because it is very easy to start in Red Hat;

VI/etc/xinetd. d/telnet
Service telnet
{
Disable = Yes
Flags = Reuse
Socket_type = stream
Wait = No
User = root
Server =/usr/sbin/in. telnetd
Log_on_failure + = userid
}

Add "#" to the front of the disable = Yes line, or change it to "Disable = No ".

That's all.

However, the xinetd. D folder is not found in/etc of ubuntu.

Xinetd. D is often seen in network configuration. What is this?

Introduction

Elastic Network
Enabled Linux applications don't rely on themselves to provide
Restricted access or bind to a participant TCP port; instead they often
Offload a lot of this work to a program suite made just for this
Purpose, xinetd.

Managing xinetd programs

The xinetd rpm
Is installed by default in Fedora Linux and uses/etc/xinetd. conf as its
Main configuration file. Fortunately you usually don't have to edit
This file so that day to day xinetd operation is frequently limited
Only starting and stopping xinetd managed applications.

Controlling xinetd

The starting and
Stopping of the xinetd daemon is controlled by the by scripts in
/Etc/init. d directory and its behavior at boot time is controlled
Chkconfig.

You can start/stop/restart xinetd after booting by using the following commands:

[root@bigboy tmp]# service xinetd start[root@bigboy tmp]# service xinetd stop[root@bigboy tmp]# service xinetd restart

To get xinetd configured to start at boot you can use the chkconfig command.

[root@bigboy tmp]# chkconfig xinetd on

Controlling xinetd-managed applications

Xinetd-managed
Applications all store their configuration files in the/etc/xinetd. d
Directory. Each configuration file has a disable statement that you can
Set to yes or no. This governs whether xinetd is allowed to start them
Or not.

You don't have
To edit these files to activate or deactivate the application.
Chkconfig command does that for you automatically will also stops or
Starts the application accordingly too! Here is an example of
Activation and deactivation of the samba SWAT web GUI Management
Application.

[Root @ bigboy TMP] # chkconfig SWAT on [root @ bigboy TMP] # chkconfig SWAT off

Xinetd is a new generation of network daemon service, also known as a super Internet server. It is often used to manage a variety of lightweight Internet services.

Xinetd provides functions similar to inetd + tcp_wrapper, but is more powerful and secure.



Basic knowledge



Linux provides services by running daemon on the background.



The daemon is used to open a port and wait for the connection to enter. In C/S mode, if the customer requests a connection, the daemon creates a (fork) sub-process to respond to the connection, and the parent process continues to listen to requests from other services.



However, if every service provided by the system must run a daemon listening for a port connection, it usually means a waste of system resources. To this end, the introduction of "Extended Network
Daemon Service Program "xinetd (xinetd Internet Daemon ). The Telnet service is also protected by xinetd.

The above estimates give you a preliminary understanding of xinetd.

4. Use xinetd to start the daemon
In principle, any system service can use xinetd. However, it is most suitable for common network services. At the same time, the number and frequency of requests for this service are not too high.
This method is not suitable for DNS and Apache.
The xinetd mode is suitable for FTP, telnet, and SSH,

By default, xinetd services can be divided into the following categories.
① Standard Internet services: Telnet and FTP.
② Information Service: Finger, netstat, and comment.
③ Mail service: IMAP, IMAPs, pop2, POP3, and POPs.
④ RPC service: rquotad, rstatd, rusersd, sprayd, and walld.
⑤ BSD service: Comsat, exec, login, NTALK, shell, and talk.
⑥ Internal services: Chargen, daytime, Echo, servers, services, and time.
7. Security Service: IRC.
Other services: name, TFTP, and uucp.
You can specify the xinetd service in the/etc/services file.

Interpretation of/etc/xinetd. conf and/etc/xinetd. d /*

1)/etc/xinetd. conf

Xinetd
The configuration file of IS/etc/xinetd. conf, but it only contains several default values and the configuration file in the/etc/xinetd. d directory. If you want to enable or disable an item
Edit the configuration file in the/etc/xinetd. d directory. For example, if the disable attribute is set to yes, the service is disabled.
Is set to no, indicating that the service is enabled. /Etc/xinetd. conf has many options. below is the/etc/xinetd. conf of RHEL 4.0.

# Simple configuration file for xinetd

# Some ults, and include/etc/xinetd. d/

Ults

{

Instances = 60

Log_type = syslog authpriv

Log_on_success = Host PID

Log_on_failure = Host

CPS = 25 30

}

Includedir/etc/xinetd. d

-Instances = 60: indicates that the maximum number of connected processes is 60.

-Log_type = syslog authpriv: syslog is used for service registration.

-Log_on_success = Host PID: process ID that records the IP address of the client after the setting is successful.

-Log_on_failure = Host: indicates that the IP address of the client is recorded after the setting fails.

-CPS = 25 30: indicates 25 inbound connections per second. If the limit is exceeded, wait for 30 seconds. It is mainly used to deal with DoS attacks.

-Includedir/etc/xinetd. D: indicates that the file or directory to be included in Xinetd is/etc/xinetd. D.

5. interpret/etc/xinetd. conf and/etc/xinetd. d /*

1)/etc/xinetd. conf

Xinetd
The configuration file of IS/etc/xinetd. conf, but it only contains several default values and the configuration file in the/etc/xinetd. d directory. If you want to enable or disable an item
Edit the configuration file in the/etc/xinetd. d directory. For example, if the disable attribute is set to yes, the service is disabled.
Is set to no, indicating that the service is enabled. /Etc/xinetd. conf has many options. below is the/etc/xinetd. conf of RHEL 4.0.

# Simple configuration file for xinetd

# Some ults, and include/etc/xinetd. d/

Ults

{

Instances = 60

Log_type = syslog authpriv

Log_on_success = Host PID

Log_on_failure = Host

CPS = 25 30

}

Includedir/etc/xinetd. d

-Instances = 60: indicates that the maximum number of connected processes is 60.

-Log_type = syslog authpriv: syslog is used for service registration.

-Log_on_success = Host PID: process ID that records the IP address of the client after the setting is successful.

-Log_on_failure = Host: indicates that the IP address of the client is recorded after the setting fails.

-CPS = 25 30: indicates 25 inbound connections per second. If the limit is exceeded, wait for 30 seconds. It is mainly used to deal with DoS attacks.

-Includedir/etc/xinetd. D: indicates that the file or directory to be included in Xinetd is/etc/xinetd. D.

2)/etc/xinetd. d /*

The following uses a file (rsync) in/etc/xinetd. d/as an example.

Service rsync

{

Disable = Yes

Socket_type = stream

Wait = No

User = root

Server =/usr/bin/rsync

Log_on_failure + = userid

}

The following describes the meaning of each row.

-Disable = yes: Indicates disabling this service.

-Socket_type = stream: indicates that the data packet type of the service is stream.

-Wait = No: indicates that the service runs in multiple threads without waiting.

-User = root: the user who executes the service process is root.

-Server =/usr/bin/rsync: the start script location.

-Log_on_failure + = userid: indicates that the UID is added to the system registration form when the setting fails.

5. Configure xinetd

1) Format

Each item in/etc/xinetd. conf takes the following form:

Service-name

{

......

}

The service is a required keyword, and the attribute table must be enclosed in braces. Each item defines a service defined by service-name.

The service-name is arbitrary, but it is usually a standard network service name. You can also add other non-standard services as long as they can be activated through network requests, including network requests sent by localhost itself. There are many attributes that can be used. Later, we will describe the required attributes and use rules of the attributes.

The operator can be =, + =, or-=. All attributes can use = to assign one or more values. Some attributes can use + = or-=, the function is to increase the value to an existing value table or delete the value from the existing value table.

2) configuration file

The related configuration files are as follows:

/Etc/xinetd. conf

/Etc/xinetd. d/* // all files in this directory

/Etc/hosts. Allow

/Etc/hosts. Deny

3) disabled and enabled

Before
The parameter is the list of Disabled Services, and the parameter is the list of enabled services. They share the same format (the attribute name, service name list, and service are separated by spaces, for example, Disabled =
In. tftpd
In. rexmcm). In addition, they all apply to the global. If this parameter is specified in the disabled list,
Disabled. If the enabled list is specified, only the services in the list can be started. If enabled is not specified, all services other than the services specified by disabled can be started.
To start.

**************************************** **************************************** *********

For more information about xinetd:

Man xinetd. Conf

**************************************** **************************************** *************

1. Declaration: This command is not available in all Linux releases. Mainly in RedHat, fedora, mandriva, and centos.

2. This command is located in the/sbin directory. You can use the file command to view the command and find it a script command.

3. The analysis script shows that the function of this command is to find the corresponding service in the/etc/init. d directory and perform operations such as enabling and disabling the command.

4. Enable httpd server: Service httpd start

You can replace 'start' with 'restart' to indicate a restart, 'stop' to indicate a shutdown, and 'reload' to re-load the configuration.

5. Disable MySQL Server: Service mysqld stop

6. We strongly recommend that you replace the service command with/etc/init. d/mysqld stop

 

 

 

Service Management andMicrosoft


Windows is not quite the same. I probably don't know much about the startup of Microsoft Server services. Let's talk about Linux services here.

There are two types of Linux services: system services, which can be automatically started when the system is started; there is also a daemon service guided by the xinet service.
Xinet is also a service that can listen to multiple specified ports at the same time. When receiving user requests, xinet can listen to different ports according to user requests, start different network service processes to process these user requests.
You can regard xinetd as a management server for starting the service. The user's port configuration can be set by changing the configuration file.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.