xinetd 守护进程

xinetd 守护进程是一个 TCP 封装的超级服务,它控制对流行网络服务子集的访问,包括 FTP、IMAP 和 telnet。
它还为访问控制、增强的日志记录、绑定、重定向和资源利用控制提供特定于服务的配置选项。

当客户端主机尝试连接到由 xinetd 控制的网络服务时,超级服务会接收请求并检查任何 TCP 包装器访问控制规则。
如果允许访问,则 xinetd 会根据其自己的访问规则验证该服务是否允许连接,并且该服务消耗的资源量没有超过其分配的资源量或者违反任何定义的规则。
然后它启动所请求服务的一个实例,并将连接控制权交给它。
一旦建立连接,xinetd 不会进一步干扰客户端主机和服务器之间的通信。

Linux 中的 /etc/xinetd.conf 文件
查看更多教程 https://on  itroad.com

/etc/xinetd.conf 文件

/etc/xinetd.conf 文件包含影响 xinetd 控制下的每个服务的一般配置设置。
xinetd 服务启动时读取一次,因此要使配置更改生效,管理员必须重新启动 xinetd 服务。
下面是一个示例 /etc/xinetd.conf 文件:

# cat /etc/xinetd.conf
#
# This is the master xinetd configuration file. Settings in the
# default section will be inherited by all service configurations
# unless explicitly overridden in the service configuration. See
# xinetd.conf in the man pages for a more detailed explanation of
# these attributes.
defaults
{
# The next two items are intended to be a quick access place to
# temporarily enable or disable services.
#
#	enabled		=
#	disabled	=
# Define general logging characteristics.
	log_type	= SYSLOG daemon info 
	log_on_failure	= HOST
	log_on_success	= PID HOST DURATION EXIT
# Define access restriction defaults
#
#	no_access	=
#	only_from	=
#	max_load	= 0
	cps		= 50 10
	instances	= 50
	per_source	= 10
# Address and networking defaults
#
#	bind		=
#	mdns		= yes
	v6only		= no
# setup environmental attributes
#
#	passenv		=
	groups		= yes
	umask		= 002
# Generally, banners are not used. This sets up their global defaults
#
#	banner		=
#	banner_fail	=
#	banner_success	=
}
includedir /etc/xinetd.d

以下是 /etc/xinetd.conf 文件中最常用的属性及其含义。

  • instances - 设置 xinetd 一次可以处理的最大请求数。
  • log_type - 配置 xinetd 以使用 authpriv 日志工具,它将日志条目写入 /var/log/secure 文件。添加诸如 FILE /var/log/xinetdlog 之类的指令将在 /var/log/ 目录中创建一个名为 xinetdlog 的自定义日志文件。
  • log_on_success - 配置 xinetd 以在连接成功时进行记录。默认情况下,会记录远程主机的 IP 地址和处理请求的服务器的进程 ID。
  • log_on_failure - 配置 xinetd 以记录连接失败或者连接不被允许的情况。
  • cps - 配置 xinetd 以允许每秒不超过 25 个连接到任何给定服务。如果达到此限制,服务将停用 30 秒。
  • includeir /etc/xinetd.d/ - 包括在位于 /etc/xinetd.d/ 目录中的特定于服务的配置文件中声明的选项。
日期:2020-09-17 00:14:32 来源:oir作者:oir