hosts_options.5 (2010 09)
h
hosts_options(5) hosts_options(5)
twist shell_command
Replace the current process by an instance of the specified shell command, after performing the
%letter expansions described in hosts_access(5).
stdin, stdout, and
stderr are connected to
the client process. This option must appear at the end of a rule.
To send a customized bounce message to the client instead of running the real ftp daemon:
ftpd : ... : twist /bin/echo 421 Some bounce message
For an alternative way to communicate with the client processes, see the
banners option below.
To run /some/other/telnetd without polluting its command-line array or its process environment:
telnetd : ... : twist PATH=/some/other; exec telnetd
WARNING: in case of UDP services, do not twist to commands that use the standard I/O or the
read()/write()
routines to communicate with the client process. UDP requires other I/O primitives.
Network Options
keepalive
Causes the server to periodically send a message to the client. The connection is considered broken
when the client does not respond. The
keepalive option can be useful when users turn off their
machine while it is still connected to a server. The
keepalive option is not useful for datagram
(UDP) services.
linger number_of_seconds
Specifies how long the kernel will try to deliver undelivered data after the server process closes a
connection.
Username Lookup Options
rfc931 [ timeout_in_seconds
]
Look up the client user name with the RFC 931 (TAP, IDENT, RFC 1413) protocol. This option is
silently ignored in case of services based on transports other than TCP. It requires that the client
system runs an RFC 931-compliant daemon (IDENT etc.) and may cause noticeable delays with con-
nections from non-UNIX clients. The timeout period is tunable through configuration file
/etc/tcpd.conf. If no or invalid timeout is specified, the user name lookup is disabled.
Miscellaneous Options
banners /some/directory
Look for a file in /some/directory with the same name as the daemon process (for example,
tel-
netd for the telnet service), and copy its contents to the client. Newline characters are replaced by
carriage-return newline, and
%letter sequences are expanded (see hosts_access(5)).
The banner option does not add any service-specific characters when sending the text to the client as
specified in the service protocol. To use this option successfully, the file must contain the necessary
protocol parameters in addition to the actual text.
For example, in an
ftpd service, the lines in the banners file are not automatically prefixed by the
status code (220-) as defined in FTP RFC 959. Therefore, if you want to send the following text to
the FTP client:
This is a sample Welcome text to demonstrate the banners
option in tcpd.
we recommend adding the protocol-specific response code as follows:
220-This is a sample Welcome text to demonstrate the banners
220-option in tcpd.
For the rlogind service, a null character (\0) must be placed at the beginning of the rlogind
banner file as specified in the following example:
# echo "\0This is a sample Welcome text to demonstrate \
the banners" > rlogind
# echo "option in tcpd." >> rlogind
2 Hewlett-Packard Company − 2 − HP-UX 11i Version 3: September 2010