此内容没有您所选择的语言版本。
17.2.2.3. Shell Commands
Option fields allow access rules to launch shell commands through the following two directives:
spawn— Launches a shell command as a child process. This option directive can perform tasks like using/usr/sbin/safe_fingerto get more information about the requesting client or create special log files using theechocommand.In the following example, clients attempting to access Telnet services from theexample.comdomain are quietly logged to a special file:in.telnetd : .example.com \ : spawn /bin/echo `/bin/date` from %h>>/var/log/telnet.log \ : allow
in.telnetd : .example.com \ : spawn /bin/echo `/bin/date` from %h>>/var/log/telnet.log \ : allowCopy to Clipboard Copied! Toggle word wrap Toggle overflow twist— Replaces the requested service with the specified command. This directive is often used to set up traps for intruders (also called "honey pots"). It can also be used to send messages to connecting clients. Thetwistdirective must occur at the end of the rule line.In the following example, clients attempting to access FTP services from theexample.comdomain are sent a message via theechocommand:vsftpd : .example.com \ : twist /bin/echo "421 Bad hacker, go away!"
vsftpd : .example.com \ : twist /bin/echo "421 Bad hacker, go away!"Copy to Clipboard Copied! Toggle word wrap Toggle overflow
For more information about shell command options, refer to the
hosts_options man page.