inetd 和 echo 服务

inetd 和 echo 服务

inetd - 来自维基百科,

inetd(互联网服务守护程序)是许多 Unix 系统上的超级服务器守护程序,提供互联网服务。对于每个配置的服务,它都会监听来自连接客户端的请求。通过生成运行相应可执行文件的进程来处理请求,但诸如 echo 之类的简单服务由 inetd 本身提供. 外部可执行文件,根据请求运行,可以是单线程或多线程的。它首次出现在 4.3BSD [1] 中,通常位于 /usr/sbin/inetd。

请告知什么是服务 - echo?

  1. 如何禁用或启用此服务?
  2. 如果我们禁用回声服务,那么它将对哪些进程/其他进程产生影响?

谢谢你的建议

 tail -20  /etc/inetd.conf 
 # Legacy configuration file for inetd(1M).  See inetd.conf(4).
 #
 # This file is no longer directly used to configure inetd.
 # The Solaris services which were formerly configured using this file
 # are now configured in the Service Management Facility (see smf(5))
 # using inetadm(1M).
 #
 # Any records remaining in this file after installation or upgrade,
 # or later created by installing additional software, must be converted
 # to smf(5) services and imported into the smf repository using
 # inetconv(1M), otherwise the service will not be available.  Once
 # a service has been converted using inetconv, further changes made to
 # its entry here are not reflected in the service.
 #
 #
 # CacheFS daemon.  Provided only as a basis for conversion by inetconv(1M).
 #
 100235/1 tli rpc/ticotsord wait root /usr/lib/fs/cachefs/cachefsd cachefsd
 # TFTPD - tftp server (primarily used for booting)
 #tftp   dgram   udp6    wait    root    /usr/sbin/in.tftpd      in.tftpd -s /tftpboot

备注-此 grep 命令的结果为空:

 grep echo /etc/inetd.conf

摘自维基百科,(Echo 协议)

Inetd 实现[编辑]在类 UNIX 操作系统中,echo 服务器内置于 inetd 守护进程中。echo 服务通常默认不启用。可以通过将以下行添加到文件 /etc/inetd.conf 并告诉 inetd 重新加载其配置来启用它:

echo   stream  tcp     nowait  root    internal
echo   dgram   udp     wait    root    internal

答案1

echo服务可以追溯到早期的互联网,当时链接并不可靠,因此,有一种方法来检查你发送的内容是否被另一端接收和理解是很有用的。因此,echo一种服务只是简单地将发送给它的任何内容发回:

[me@lory ~]$ telnet localhost echo
Trying ::1...
Connected to localhost.
Escape character is '^]'.
asdf
asdf
please echo this
please echo this
it is for testing
it is for testing
^]
telnet> quit

现代互联网通常不需要它,任何服务都不应依赖它。我们无法肯定,但禁用它不太可能会给您带来麻烦。

如果它没有运行,您将看到尝试连接没有监听器的未过滤端口的标准输出:

[me@lory ~]$ telnet localhost echo
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused

还有一种 UDP 回显服务,可以使用例如以类似的方式进行测试netcat

为避免疑问,虽然禁用回声服务可能是安全的,但同样不是对于 inetd 来说确实如此,如果它正在运行,它几乎肯定负责您需要的服务。 不要尝试通过禁用 inetd 来禁用 echo

相关内容