]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/inetd/inetd.8
Stop #defining FREEBSD_ELF
[FreeBSD/FreeBSD.git] / usr.sbin / inetd / inetd.8
1 .\" Copyright (c) 1985, 1991, 1993, 1994
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     from: @(#)inetd.8       8.3 (Berkeley) 4/13/94
29 .\"
30 .Dd December 6, 2021
31 .Dt INETD 8
32 .Os
33 .Sh NAME
34 .Nm inetd
35 .Nd internet
36 .Dq super-server
37 .Sh SYNOPSIS
38 .Nm
39 .Op Fl dlWw
40 .Op Fl a Ar address
41 .Op Fl C Ar rate
42 .Op Fl c Ar maximum
43 .Op Fl p Ar filename
44 .Op Fl R Ar rate
45 .Op Fl s Ar maximum
46 .Op Ar configuration_file
47 .Sh DESCRIPTION
48 The
49 .Nm
50 utility should be run at boot time by
51 .Pa /etc/rc
52 (see
53 .Xr rc 8 ) .
54 It then listens for connections on certain
55 internet sockets.
56 When a connection is found on one
57 of its sockets, it decides what service the socket
58 corresponds to, and invokes a program to service the request.
59 The server program is invoked with the service socket
60 as its standard input, output and error descriptors.
61 After the program is
62 finished,
63 .Nm
64 continues to listen on the socket (except in some cases which
65 will be described below).
66 Essentially,
67 .Nm
68 allows running one daemon to invoke several others,
69 reducing load on the system.
70 .Pp
71 The following options are available:
72 .Bl -tag -width indent
73 .It Fl a Ar address
74 Specify one specific IP address to bind to.
75 Alternatively, a hostname can be specified,
76 in which case the IPv4 or IPv6 address
77 which corresponds to that hostname is used.
78 Usually a hostname is specified when
79 .Nm
80 is run inside a
81 .Xr jail 8 ,
82 in which case the hostname corresponds to that of the
83 .Xr jail 8
84 environment.
85 .Pp
86 When the hostname specification is used
87 and both IPv4 and IPv6 bindings are desired,
88 one entry with the appropriate
89 .Em protocol
90 type for each binding
91 is required for each service in
92 .Pa /etc/inetd.conf .
93 For example,
94 a TCP-based service would need two entries,
95 one using
96 .Dq tcp4
97 for the
98 .Em protocol
99 and the other using
100 .Dq tcp6 .
101 See the explanation of the
102 .Pa /etc/inetd.conf
103 .Em protocol
104 field below.
105 .It Fl C Ar rate
106 Specify the default maximum number of times a service can be invoked
107 from a single IP address in one minute; the default is unlimited.
108 May be overridden on a per-service basis with the
109 "max-connections-per-ip-per-minute" parameter.
110 .It Fl c Ar maximum
111 Specify the default maximum number of
112 simultaneous invocations of each service;
113 the default is unlimited.
114 May be overridden on a per-service basis with the "max-child"
115 parameter.
116 .It Fl d
117 Turn on debugging.
118 .It Fl l
119 Turn on logging of successful connections.
120 .It Fl p
121 Specify an alternate file in which to store the process ID.
122 .It Fl R Ar rate
123 Specify the maximum number of times a service can be invoked
124 in one minute; the default is 256.
125 A rate of 0 allows an unlimited number of invocations.
126 .It Fl s Ar maximum
127 Specify the default maximum number of
128 simultaneous invocations of each service from a single IP address;
129 the default is unlimited.
130 May be overridden on a per-service basis with the "max-child-per-ip"
131 parameter.
132 .It Fl W
133 Turn on TCP Wrapping for internal services which are built in to
134 .Nm .
135 .It Fl w
136 Turn on TCP Wrapping for external services.
137 See the
138 .Sx "IMPLEMENTATION NOTES"
139 section for more information on TCP Wrappers support.
140 .El
141 .Pp
142 Upon execution,
143 .Nm
144 reads its configuration information from a configuration
145 file which, by default, is
146 .Pa /etc/inetd.conf .
147 There must be an entry for each field of the configuration
148 file, with entries for each field separated by a tab or
149 a space.
150 Comments are denoted by a
151 .Dq #
152 at the beginning
153 of a line.
154 There must be an entry for each field.
155 The
156 fields of the configuration file are as follows:
157 .Pp
158 .Bd -unfilled -offset indent -compact
159 service-name
160 socket-type
161 protocol
162 {wait|nowait}[/max-child[/max-connections-per-ip-per-minute[/max-child-per-ip]]]
163 user[:group][/login-class]
164 server-program
165 server-program-arguments
166 .Ed
167 .Pp
168 To specify an
169 ONC RPC-based
170 service, the entry would contain these fields:
171 .Pp
172 .Bd -unfilled -offset indent -compact
173 service-name/version
174 socket-type
175 rpc/protocol
176 {wait|nowait}[/max-child[/max-connections-per-ip-per-minute[/max-child-per-ip]]]
177 user[:group][/login-class]
178 server-program
179 server-program-arguments
180 .Ed
181 .Pp
182 There are two types of services that
183 .Nm
184 can start: standard and TCPMUX.
185 A standard service has a well-known port assigned to it;
186 it may be a service that implements an official Internet standard or is a
187 .Bx Ns -specific
188 service.
189 As described in
190 RFC 1078,
191 TCPMUX services are nonstandard services that do not have a
192 well-known port assigned to them.
193 They are invoked from
194 .Nm
195 when a program connects to the
196 .Dq tcpmux
197 well-known port and specifies
198 the service name.
199 This feature is useful for adding locally-developed servers.
200 TCPMUX requests are only accepted when the multiplexor service itself
201 is enabled, above and beyond and specific TCPMUX-based servers; see the
202 discussion of internal services below.
203 .Pp
204 The
205 .Em service-name
206 entry is the name of a valid service in
207 the file
208 .Pa /etc/services ,
209 or the specification of a
210 .Ux
211 domain socket (see below).
212 For
213 .Dq internal
214 services (discussed below), the service
215 name
216 should
217 be the official name of the service (that is, the first entry in
218 .Pa /etc/services ) .
219 When used to specify an
220 ONC RPC-based
221 service, this field is a valid RPC service name listed in
222 the file
223 .Pa /etc/rpc .
224 The part on the right of the
225 .Dq /
226 is the RPC version number.
227 This
228 can simply be a single numeric argument or a range of versions.
229 A range is bounded by the low version to the high version -
230 .Dq rusers/1-3 .
231 For TCPMUX services, the value of the
232 .Em service-name
233 field consists of the string
234 .Dq tcpmux
235 followed by a slash and the
236 locally-chosen service name.
237 The service names listed in
238 .Pa /etc/services
239 and the name
240 .Dq help
241 are reserved.
242 Try to choose unique names for your TCPMUX services by prefixing them with
243 your organization's name and suffixing them with a version number.
244 .Pp
245 The
246 .Em socket-type
247 should be one of
248 .Dq stream ,
249 .Dq dgram ,
250 .Dq raw ,
251 .Dq rdm ,
252 or
253 .Dq seqpacket ,
254 depending on whether the socket is a stream, datagram, raw,
255 reliably delivered message, or sequenced packet socket.
256 TCPMUX services must use
257 .Dq stream .
258 .Pp
259 The
260 .Em protocol
261 must be a valid protocol or
262 .Dq unix .
263 Examples are
264 .Dq tcp
265 or
266 .Dq udp ,
267 both of which imply IPv4 for backward compatibility.
268 The names
269 .Dq tcp4
270 and
271 .Dq udp4
272 specify IPv4 only.
273 The names
274 .Dq tcp6
275 and
276 .Dq udp6
277 specify IPv6 only.
278 The names
279 .Dq tcp46
280 and
281 .Dq udp46
282 specify that the entry accepts both IPv4 and IPv6 connections
283 via a wildcard
284 .Dv AF_INET6
285 socket.
286 Rpc based services
287 are specified with the
288 .Dq rpc/tcp
289 or
290 .Dq rpc/udp
291 service type.
292 One can use specify IPv4 and/or IPv6 with the 4, 6 or 46 suffix, for example
293 .Dq rpc/tcp6
294 or
295 .Dq rpc/udp46 .
296 TCPMUX services must use
297 .Dq tcp ,
298 .Dq tcp4 ,
299 .Dq tcp6
300 or
301 .Dq tcp46 .
302 .Pp
303 The
304 .Em wait/nowait
305 entry specifies whether the server that is invoked by
306 .Nm
307 will take over
308 the socket associated with the service access point, and thus whether
309 .Nm
310 should wait for the server to exit before listening for new service
311 requests.
312 Datagram servers must use
313 .Dq wait ,
314 as they are always invoked with the original datagram socket bound
315 to the specified service address.
316 These servers must read at least one datagram from the socket
317 before exiting.
318 If a datagram server connects
319 to its peer, freeing the socket so
320 .Nm
321 can receive further messages on the socket, it is said to be
322 a
323 .Dq multi-threaded
324 server;
325 it should read one datagram from the socket and create a new socket
326 connected to the peer.
327 It should fork, and the parent should then exit
328 to allow
329 .Nm
330 to check for new service requests to spawn new servers.
331 Datagram servers which process all incoming datagrams
332 on a socket and eventually time out are said to be
333 .Dq single-threaded .
334 The
335 .Xr comsat 8
336 and
337 .Xr talkd 8
338 utilities are examples of the latter type of
339 datagram server.
340 The
341 .Xr tftpd 8
342 utility is an example of a multi-threaded datagram server.
343 .Pp
344 Servers using stream sockets generally are multi-threaded and
345 use the
346 .Dq nowait
347 entry.
348 Connection requests for these services are accepted by
349 .Nm ,
350 and the server is given only the newly-accepted socket connected
351 to a client of the service.
352 Most stream-based services operate in this manner.
353 Stream-based servers that use
354 .Dq wait
355 are started with the listening service socket, and must accept
356 at least one connection request before exiting.
357 Such a server would normally accept and process incoming connection
358 requests until a timeout.
359 TCPMUX services must use
360 .Dq nowait .
361 .Pp
362 The maximum number of outstanding child processes (or
363 .Dq threads )
364 for a
365 .Dq nowait
366 service may be explicitly specified by appending a
367 .Dq /
368 followed by the number to the
369 .Dq nowait
370 keyword.
371 Normally
372 (or if a value of zero is specified) there is no maximum.
373 Otherwise,
374 once the maximum is reached, further connection attempts will be
375 queued up until an existing child process exits.
376 This also works
377 in the case of
378 .Dq wait
379 mode, although a value other than one (the
380 default) might not make sense in some cases.
381 You can also specify the maximum number of connections per minute
382 for a given IP address by appending
383 a
384 .Dq /
385 followed by the number to the maximum number of
386 outstanding child processes.
387 Once the maximum is reached, further
388 connections from this IP address will be dropped until the end of the
389 minute.
390 In addition, you can specify the maximum number of simultaneous
391 invocations of each service from a single IP address by appending a
392 .Dq /
393 followed by the number to the maximum number of outstanding child
394 processes.
395 Once the maximum is reached, further connections from this
396 IP address will be dropped.
397 .Pp
398 The
399 .Em user
400 entry should contain the user name of the user as whom the server
401 should run.
402 This allows for servers to be given less permission
403 than root.
404 The optional
405 .Em group
406 part separated by
407 .Dq \&:
408 allows a group name other
409 than the default group for this user to be specified.
410 The optional
411 .Em login-class
412 part separated by
413 .Dq /
414 allows specification of a login class other
415 than the default
416 .Dq daemon
417 login class.
418 .Pp
419 The
420 .Em server-program
421 entry should contain the pathname of the program which is to be
422 executed by
423 .Nm
424 when a request is found on its socket.
425 If
426 .Nm
427 provides this service internally, this entry should
428 be
429 .Dq internal .
430 .Pp
431 The
432 .Em server-program-arguments
433 entry lists the arguments to be passed to the
434 .Em server-program ,
435 starting with argv[0], which usually is the name of
436 the program.
437 If the service is provided internally, the
438 .Em service-name
439 of the service (and any arguments to it) or the word
440 .Dq internal
441 should take the place of this entry.
442 .Pp
443 Currently, the only internal service to take arguments is
444 .Dq auth .
445 Without options, the service will always return
446 .Dq ERROR\ : HIDDEN-USER .
447 The available arguments to this service that alter its behavior are:
448 .Bl -tag -width indent
449 .It Fl d Ar fallback
450 Provide a
451 .Ar fallback
452 username.
453 If the real
454 .Dq auth
455 service is enabled
456 (with the
457 .Fl r
458 option discussed below),
459 return this username instead of an error
460 when lookups fail
461 for either socket credentials or the username.
462 If the real
463 .Dq auth
464 service is disabled,
465 return this username for every request.
466 This is primarily useful when running this service on a NAT machine.
467 .It Fl F
468 Same as
469 .Fl f
470 but without the restriction that the username in
471 .Pa .fakeid
472 must not match an existing user.
473 .It Fl f
474 If the file
475 .Pa .fakeid
476 exists in the home directory of the identified user, report the username
477 found in that file instead of the real username.
478 If the username found in
479 .Pa .fakeid
480 is that of an existing user,
481 then the real username is reported.
482 If the
483 .Fl i
484 flag is also given then the username in
485 .Pa .fakeid
486 is checked against existing user IDs instead.
487 .It Fl g
488 Instead of returning
489 the user's name to the ident requester,
490 report a
491 username made up of random alphanumeric characters,
492 e.g.,
493 .Dq c0c993 .
494 The
495 .Fl g
496 flag overrides not only the user names,
497 but also any fallback name,
498 .Pa .fakeid
499 or
500 .Pa .noident
501 files.
502 .It Fl i
503 Return numeric user IDs instead of usernames.
504 .It Fl n
505 If the file
506 .Pa .noident
507 exists in the home directory of the identified user, return
508 .Dq ERROR\ : HIDDEN-USER .
509 This overrides any
510 .Pa fakeid
511 file which might exist.
512 .It Fl o Ar osname
513 Use
514 .Ar osname
515 instead of the name of the system as reported by
516 .Xr uname 3 .
517 .It Fl r
518 Offer a real
519 .Dq auth
520 service, as per RFC 1413.
521 All the remaining flags apply only in this case.
522 .It Fl t Xo
523 .Ar sec Ns Op Cm \&. Ns Ar usec
524 .Xc
525 Specify a timeout for the service.
526 The default timeout is 10.0 seconds.
527 .El
528 .Pp
529 The
530 .Nm
531 utility also provides several other
532 .Dq trivial
533 services internally by use of
534 routines within itself.
535 These services are
536 .Dq echo ,
537 .Dq discard ,
538 .Dq chargen
539 (character generator),
540 .Dq daytime
541 (human readable time), and
542 .Dq time
543 (machine readable time, in the form of the number of seconds since
544 midnight, January 1, 1900).
545 All of these services are available in
546 both TCP and UDP versions; the UDP versions will refuse service if the
547 request specifies a reply port corresponding to any internal service.
548 (This is done as a defense against looping attacks; the remote IP address
549 is logged.)
550 For details of these services, consult the
551 appropriate
552 RFC
553 document.
554 .Pp
555 The TCPMUX-demultiplexing service is also implemented as an internal service.
556 For any TCPMUX-based service to function, the following line must be included
557 in
558 .Pa inetd.conf :
559 .Bd -literal -offset indent
560 tcpmux  stream  tcp     nowait  root    internal
561 .Ed
562 .Pp
563 When given the
564 .Fl l
565 option
566 .Nm
567 will log an entry to syslog each time a connection is accepted, noting the
568 service selected and the IP-number of the remote requester if available.
569 Unless otherwise specified in the configuration file,
570 and in the absence of the
571 .Fl W
572 and
573 .Fl w
574 options,
575 .Nm
576 will log to the
577 .Dq daemon
578 facility.
579 .Pp
580 The
581 .Nm
582 utility rereads its configuration file when it receives a hangup signal,
583 .Dv SIGHUP .
584 Services may be added, deleted or modified when the configuration file
585 is reread.
586 Except when started in debugging mode,
587 or configured otherwise with the
588 .Fl p
589 option,
590 .Nm
591 records its process ID in the file
592 .Pa /var/run/inetd.pid
593 to assist in reconfiguration.
594 .Sh IMPLEMENTATION NOTES
595 .Ss TCP Wrappers
596 When given the
597 .Fl w
598 option,
599 .Nm
600 will wrap all services specified as
601 .Dq stream nowait
602 or
603 .Dq dgram
604 except for
605 .Dq internal
606 services.
607 If the
608 .Fl W
609 option is given, such
610 .Dq internal
611 services will be wrapped.
612 If both options are given, wrapping for both
613 internal and external services will be enabled.
614 Either wrapping option
615 will cause failed connections to be logged to the
616 .Dq auth
617 syslog facility.
618 Adding the
619 .Fl l
620 flag to the wrapping options will include successful connections in the
621 logging to the
622 .Dq auth
623 facility.
624 .Pp
625 Note that
626 .Nm
627 only wraps requests for a
628 .Dq wait
629 service while no servers are available to service requests.
630 Once a
631 connection to such a service has been allowed,
632 .Nm
633 has no control
634 over subsequent connections to the service until no more servers
635 are left listening for connection requests.
636 .Pp
637 When wrapping is enabled, the
638 .Pa tcpd
639 daemon is not required, as that functionality is builtin.
640 For more information on TCP Wrappers, see the relevant documentation
641 .Pq Xr hosts_access 5 .
642 When reading that document, keep in mind that
643 .Dq internal
644 services have no associated daemon name.
645 Therefore, the service name
646 as specified in
647 .Pa inetd.conf
648 should be used as the daemon name for
649 .Dq internal
650 services.
651 .Ss TCPMUX
652 RFC 1078
653 describes the TCPMUX protocol:
654 ``A TCP client connects to a foreign host on TCP port 1.
655 It sends the
656 service name followed by a carriage-return line-feed <CRLF>.
657 The
658 service name is never case sensitive.
659 The server replies with a
660 single character indicating positive (+) or negative (\-)
661 acknowledgment, immediately followed by an optional message of
662 explanation, terminated with a <CRLF>.
663 If the reply was positive,
664 the selected protocol begins; otherwise the connection is closed.''
665 The program is passed the TCP connection as file descriptors 0 and 1.
666 .Pp
667 If the TCPMUX service name begins with a
668 .Dq + ,
669 .Nm
670 returns the positive reply for the program.
671 This allows you to invoke programs that use stdin/stdout
672 without putting any special server code in them.
673 .Pp
674 The special service name
675 .Dq help
676 causes
677 .Nm
678 to list the TCPMUX services which are enabled in
679 .Pa inetd.conf .
680 .Ss IPsec
681 The implementation includes a tiny hack
682 to support IPsec policy settings for each socket.
683 A special form of comment line, starting with
684 .Dq Li #@ ,
685 is interpreted as a policy specifier.
686 Everything after the
687 .Dq Li #@
688 will be used as an IPsec policy string,
689 as described in
690 .Xr ipsec_set_policy 3 .
691 Each
692 policy specifier is applied to all the following lines in
693 .Pa inetd.conf
694 until the next policy specifier.
695 An empty policy specifier resets the IPsec policy.
696 .Pp
697 If an invalid IPsec policy specifier appears in
698 .Pa inetd.conf ,
699 .Nm
700 will provide an error message via the
701 .Xr syslog 3
702 interface and abort execution.
703 .Ss Ux Domain Sockets
704 In addition to running services on IP sockets,
705 .Nm
706 can also manage
707 .Ux
708 domain sockets.
709 To do this you specify a
710 .Em protocol
711 of
712 .Dq unix
713 and specify the
714 .Ux
715 domain socket as the
716 .Em service-name .
717 The
718 .Em service-type
719 may be
720 .Dq stream
721 or
722 .Dq dgram .
723 The specification of the socket must be
724 an absolute path name,
725 optionally prefixed by an owner and mode
726 of the form
727 .Em ":user:group:mode\&:" .
728 The specification:
729 .Pp
730 .Dl ":news:daemon:220:/var/run/sock"
731 .Pp
732 creates a socket owned
733 by user
734 .Dq news
735 in group
736 .Dq daemon
737 with permissions allowing only that user and group to connect.
738 The default owner is the user that
739 .Nm
740 is running as.
741 The default mode only allows the socket's owner to connect.
742 .Pp
743 .Sy WARNING :
744 while creating a
745 .Ux
746 domain socket,
747 .Nm
748 must change the ownership and permissions on the socket.
749 This can only be done securely if
750 the directory in which the socket is created
751 is writable only by root.
752 Do
753 .Em NOT
754 use
755 .Nm
756 to create sockets in world writable directories
757 such as
758 .Pa /tmp ;
759 use
760 .Pa /var/run
761 or a similar directory instead.
762 .Pp
763 Internal services may be run on
764 .Ux
765 domain sockets, in the usual way.
766 In this case
767 the name of the internal service
768 is determined using
769 the last component of the socket's pathname.
770 For example, specifying a socket named
771 .Pa /var/run/chargen
772 would invoke the
773 .Dq chargen
774 service when a connection is received on that socket.
775 .Sh "FILES"
776 .Bl -tag -width /var/run/inetd.pid -compact
777 .It Pa /etc/inetd.conf
778 configuration file
779 .It Pa /etc/netconfig
780 network configuration data base
781 .It Pa /etc/rpc
782 translation of service names to RPC program numbers
783 .It Pa /etc/services
784 translation of service names to port numbers
785 .It Pa /var/run/inetd.pid
786 the pid of the currently running
787 .Nm
788 .El
789 .Sh "EXAMPLES"
790 Here are several example service entries for the various types of services:
791 .Bd -literal
792 # The first four launch the relevant daemon when a connection on a port
793 # as defined by /etc/services is opened.
794 ftp          stream  tcp   nowait root  /usr/libexec/ftpd        ftpd -l
795 ntalk        dgram   udp   wait   root  /usr/libexec/ntalkd      ntalkd
796 telnet       stream  tcp6  nowait root  /usr/libexec/telnetd  telnetd
797 shell        stream  tcp46  nowait root  /usr/libexec/rshd rshd
798
799 # Let the system respond to date requests via tcpmux
800 tcpmux/+date stream  tcp   nowait guest /bin/date                date
801
802 # Let people access the system phonebook via tcpmux
803 tcpmux/phonebook stream tcp nowait guest /usr/local/bin/phonebook phonebook
804
805 # Make kernel statistics accessible
806 rstatd/1-3   dgram   rpc/udp wait root  /usr/libexec/rpc.rstatd  rpc.rstatd
807
808 # Use netcat as a one-shot HTTP proxy with nc (from freebsd-tips fortune)
809 http         stream  tcp   nowait nobody /usr/bin/nc nc -N dest-ip 80
810
811 # Set up a unix socket at /var/run/echo that echo's back whatever is written
812 # to it.
813 /var/run/echo stream unix  nowait root  internal
814
815 # Run chargen for IPsec Authentication Headers
816 #@ ipsec ah/require
817 chargen      stream  tcp   nowait root  internal
818 #@
819 .Ed
820 .Sh "ERROR MESSAGES"
821 The
822 .Nm
823 server
824 logs error messages using
825 .Xr syslog 3 .
826 Important error messages and their explanations are:
827 .Pp
828 .Bl -ohang -compact
829 .It Xo
830 .Ar service Ns / Ns Ar protocol
831 .No "server failing (looping), service terminated."
832 .Xc
833 The number of requests for the specified service in the past minute
834 exceeded the limit.
835 The limit exists to prevent a broken program
836 or a malicious user from swamping the system.
837 This message may occur for several reasons:
838 .Bl -enum -offset indent
839 .It
840 There are many hosts requesting the service within a short time period.
841 .It
842 A broken client program is requesting the service too frequently.
843 .It
844 A malicious user is running a program to invoke the service in
845 a denial-of-service attack.
846 .It
847 The invoked service program has an error that causes clients
848 to retry quickly.
849 .El
850 .Pp
851 Use the
852 .Fl R Ar rate
853 option,
854 as described above, to change the rate limit.
855 Once the limit is reached, the service will be
856 reenabled automatically in 10 minutes.
857 .Pp
858 .It Xo
859 .Ar service Ns / Ns Ar protocol :
860 .No \&No such user
861 .Ar user ,
862 .No service ignored
863 .Xc
864 .It Xo
865 .Ar service Ns / Ns Ar protocol :
866 .No getpwnam :
867 .Ar user :
868 .No \&No such user
869 .Xc
870 No entry for
871 .Ar user
872 exists in the
873 .Xr passwd 5
874 database.
875 The first message
876 occurs when
877 .Nm
878 (re)reads the configuration file.
879 The second message occurs when the
880 service is invoked.
881 .Pp
882 .It Xo
883 .Ar service :
884 .No can't set uid
885 .Ar uid
886 .Xc
887 .It Xo
888 .Ar service :
889 .No can't set gid
890 .Ar gid
891 .Xc
892 The user or group ID for the entry's
893 .Ar user
894 field is invalid.
895 .Pp
896 .It "setsockopt(SO_PRIVSTATE): Operation not supported"
897 The
898 .Nm
899 utility attempted to renounce the privileged state associated with a
900 socket but was unable to.
901 .Pp
902 .It Xo unknown
903 .Ar rpc/udp
904 or
905 .Ar rpc/tcp
906 .Xc
907 No entry was found for either
908 .Ar udp
909 or
910 .Ar tcp
911 in the
912 .Xr netconfig 5
913 database.
914 .Pp
915 .It Xo unknown
916 .Ar rpc/udp6
917 or
918 .Ar rpc/tcp6
919 .Xc
920 No entry was found for either
921 .Ar udp6
922 or
923 .Ar tcp6
924 in the
925 .Xr netconfig 5
926 database.
927 .El
928 .Sh SEE ALSO
929 .Xr nc 1 ,
930 .Xr ipsec_set_policy 3 ,
931 .Xr hosts_access 5 ,
932 .Xr hosts_options 5 ,
933 .Xr login.conf 5 ,
934 .Xr netconfig 5 ,
935 .Xr passwd 5 ,
936 .Xr rpc 5 ,
937 .Xr services 5 ,
938 .Xr comsat 8 ,
939 .Xr fingerd 8 ,
940 .Xr ftpd 8 ,
941 .Xr rlogind 8 ,
942 .Xr rpcbind 8 ,
943 .Xr rshd 8 ,
944 .Xr talkd 8 ,
945 .Xr telnetd 8 ,
946 .Xr tftpd 8
947 .Rs
948 .%A Michael C. St. Johns
949 .%T Identification Protocol
950 .%O RFC1413
951 .Re
952 .Sh HISTORY
953 The
954 .Nm
955 utility appeared in
956 .Bx 4.3 .
957 TCPMUX is based on code and documentation by Mark Lottor.
958 Support for
959 ONC RPC-based services is modeled after that
960 provided by
961 SunOS
962 4.1.
963 The IPsec hack was contributed by the KAME project in 1999.
964 The
965 .Fx
966 TCP Wrappers support first appeared in
967 .Fx 3.2 .