inetd和echo服务

inetd – 维基百科,

inetd(Internet服务守护进程)是许多提供Internet服务的Unix系统上的超级服务器守护进程。 对于每个configuration的服务,它都会侦听来自连接客户端的请求。 通过产生一个运行适当的可执行程序的进程来执行请求, 但是inetd本身也提供简单的服务,如echo 。 根据请求运行的外部可执行文件可以是单线程或multithreading的。 首先出现在4.3BSD [1]中,它通常位于/ usr / sbin / inetd。

请咨询什么是服务 – 回声?

  1. 如何禁用或启用此服务?
  2. 如果我们禁用回声服务,那么在什么过程/其他将会影响?

thx的build议

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 

从维基百科,(回声协议)

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

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

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以类似的方式进行testing。

为了避免疑惑,尽pipe禁用echo服务可能是安全的,但inetd也是如此,如果运行几乎肯定会对您所需的服务负责。 不要试图通过禁用inetd来禁用回显