3

inetd - From Wikipedia,

inetd (internet service daemon) is a super-server daemon on many Unix systems that provides Internet services. For each configured service, it listens for requests from connecting clients. Requests are served by spawning a process which runs the appropriate executable, but simple services such as echo are served by inetd itself. External executables, which are run on request, can be single- or multi-threaded. First appearing in 4.3BSD [1], it is generally located at /usr/sbin/inetd.

please advice what is the service - echo ?

  1. how to disable or enable this service ?
  2. if we disable the echo service then on what process/other it will be affect ?

thx for the advice

 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

remark - the results of this grep command is empty:

 grep echo /etc/inetd.conf

From Wikipedia, ( Echo protocol )

Inetd implementation[edit]On UNIX-like operating systems an echo server is built into the inetd daemon. The echo service is usually not enabled by default. It may be enabled by adding the following lines to the file /etc/inetd.conf and telling inetd to reload its configuration:

echo   stream  tcp     nowait  root    internal
echo   dgram   udp     wait    root    internal
maihabunash
  • 443
  • 1
  • 11
  • 25
  • As the comment in the file you quoted says, on Solaris 10 and later, inetd services are managed via the [inetadm](https://docs.oracle.com/cd/E36784_01/html/E36871/inetadm-1m.html) command, not via editing the `inetd.conf` file, so using grep on inetd.conf is pointless. – alanc Nov 28 '14 at 18:10

1 Answers1

4

The echo service is a service that dates back to the early internet, when links were unreliable, and it was useful to have a way of checking that what you were sending was received and understood by the other end. So echo is a service that simply sends back whatever was sent to it:

[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

It isn't generally needed in the modern internet, and no service should be relying on it. We can't say for sure, but it is unlikely that you will cause yourself problems by disabling it.

If it's not running, you'll see the standard output for trying to connect to an unfiltered port with no listener:

[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

There's a UDP echo service as well, which can likely be tested in an analagous way using eg netcat.

For the avoidance of doubt, whilst disabling the echo service is probably safe, the same is not true for inetd, which if running is almost certainly responsible for services you need. Do not try to disable echo by disabling inetd.

MadHatter
  • 78,442
  • 20
  • 178
  • 229
  • so for example if I want to ping to some linux machine and echo service is disables then I will not get any ping answer ? – maihabunash Nov 26 '14 at 09:00
  • how to disable / enable echo service ( regarding that you not recomended to use the inetd file ) – maihabunash Nov 26 '14 at 09:01
  • +1 for your answer .... – maihabunash Nov 26 '14 at 09:04
  • you wrote - Do not try to disable echo by disabling inetd. so if not by inetd then what the alternative option to disable this service ( echo ) ??? – maihabunash Nov 26 '14 at 09:24
  • @maihabunash can you **edit into your question** the results of `grep echo /etc/inetd.conf`? – MadHatter Nov 26 '14 at 09:39
  • yes , but no echo command in my inetd.conf file , – maihabunash Nov 26 '14 at 10:24
  • Then you can't disable it whilst still running inetd (sucks to be on Solaris; `xinetd` does allow the builtins to be disabled). You'll either need to disable inetd, which is a much more significant step requiring much thought, or live with `echo` running. Is it causing any actual problems? – MadHatter Nov 26 '14 at 10:27
  • please look on this link http://en.wikipedia.org/wiki/Echo_Protocol , ( Inetd implementation ) so according to what they written seems that in my machine the echo service is disabled anyway ( as default ) , if we want to enabled it we need to add the echo line in the file is it correct ? – maihabunash Nov 26 '14 at 10:35
  • @maihabunash: this question is beginning to look distinctly non-professional to me. Is echo running right now? Do you want it to run? Do you have a good business reason for wanting to change anything? – MadHatter Nov 26 '14 at 10:36
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/18986/discussion-between-maihabunash-and-madhatter). – maihabunash Nov 26 '14 at 10:39
  • sorry I am little confuse you said “Then you can't disable it” but according to the info from http://serverfault.com/questions/647160/inetd-and-echo-service , when the file is without echo command then echo service is disabled anyway , so from my understanding we can enable echo service by adding the echo lines in to inetd.conf file or to disable it by delete the echo line from the file , – maihabunash Nov 26 '14 at 10:51