検索

このコンテンツは選択した言語では利用できません。

17.2.2.4. Expansions

download PDF
Expansions, when used in conjunction with the spawn and twist directives, provide information about the client, server, and processes involved.
Below is a list of supported expansions:
  • %a — Supplies the client's IP address.
  • %A — Supplies the server's IP address.
  • %c — Supplies a variety of client information, such as the username and hostname, or the username and IP address.
  • %d — Supplies the daemon process name.
  • %h — Supplies the client's hostname (or IP address, if the hostname is unavailable).
  • %H — Supplies the server's hostname (or IP address, if the hostname is unavailable).
  • %n — Supplies the client's hostname. If unavailable, unknown is printed. If the client's hostname and host address do not match, paranoid is printed.
  • %N — Supplies the server's hostname. If unavailable, unknown is printed. If the server's hostname and host address do not match, paranoid is printed.
  • %p — Supplies the daemon process ID.
  • %s —Supplies various types of server information, such as the daemon process and the host or IP address of the server.
  • %u — Supplies the client's username. If unavailable, unknown is printed.
The following sample rule uses an expansion in conjunction with the spawn command to identify the client host in a customized log file.
When connections to the SSH daemon (sshd) are attempted from a host in the example.com domain, execute the echo command to log the attempt, including the client hostname (by using the %h expansion), to a special file:
sshd : .example.com  \
: spawn /bin/echo `/bin/date` access denied to %h>>/var/log/sshd.log \
: deny
Similarly, expansions can be used to personalize messages back to the client. In the following example, clients attempting to access FTP services from the example.com domain are informed that they have been banned from the server:
vsftpd : .example.com \
: twist /bin/echo "421 %h has been banned from this server!"
For a full explanation of available expansions, as well as additional access control options, refer to section 5 of the man pages for hosts_access (man 5 hosts_access) and the man page for hosts_options.
For additional information about TCP wrappers, refer to Section 17.5, “Additional Resources”. For more information about how to secure TCP wrappers, refer to the chapter titled Server Security in the Security Guide.
Red Hat logoGithubRedditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

© 2024 Red Hat, Inc.