linux – inetd和echo服务

前端之家收集整理的这篇文章主要介绍了linux – inetd和echo服务前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
inetd – 来自维基百科,

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

请告知什么是服务 – 回声?

>如何禁用或启用此服务?
>如果我们禁用echo服务,那么它将影响哪个进程/其他进程?

thx的建议

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

remark – 此grep命令的结果为空:

  1. grep echo /etc/inetd.conf

来自维基百科,(回声协议)

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

  1. echo stream tcp nowait root internal
  2. echo dgram udp wait root internal

解决方法

回声服务是一种可以追溯到早期互联网的服务,当链接不可靠时,有一种方法可以检查您发送的内容是否被另一端接收和理解.所以echo是一种服务,只需发送回发送给它的任何内容
  1. [me@lory ~]$telnet localhost echo
  2. Trying ::1...
  3. Connected to localhost.
  4. Escape character is '^]'.
  5. asdf
  6. asdf
  7. please echo this
  8. please echo this
  9. it is for testing
  10. it is for testing
  11. ^]
  12. telnet> quit

在现代互联网中通常不需要它,并且任何服务都不应该依赖它.我们不能肯定地说,但你不太可能通过禁用它来引起自己的问题.

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

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

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

为避免疑问,虽然禁用echo服务可能是安全的,但inetd也是如此,如果运行几乎肯定对您需要的服务负责.不要尝试通过禁用inetd来禁用echo.

猜你在找的Linux相关文章