Sponsored Link

TCP Wrapperの設定



 戻る


# vi /etc/hosts.allowとすると
=========================================================
#
# hosts.allow   This file describes the names of the hosts which are
#               allowed to use the local INET services, as decided
#               by the '/usr/sbin/tcpd' server.
#
=========================================================
となっているので、以下を書き加える。
=================
ALL : 192.168.2.2
=================

# vi /etc/hosts.denyとすると
==============================================================
#
# hosts.deny    This file describes the names of the hosts which are
#               *not* allowed to use the local INET services, as decided
#               by the '/usr/sbin/tcpd' server.
#
# The portmap line is redundant, but it is left to remind you that
# the new secure portmap uses hosts.deny and hosts.allow.  In particular
# you should know that NFS uses portmap!
==============================================================
となっているので、以下を書き加える。
=================
ALL : ALL
=================

これで、xinetd、sshd等のサービスデーモンはIPアドレス192.168.2.2からのア
クセスしか許可しない。
もっと細かい設定も出来る。たとえば、/etc/hosts.allowに以下を書き加える。
==================
sshd : 192.168.2.3
vsftpd : 192.168.2.4
==================
とすると、sshdは192.168.2.3からのアクセスは許可するが、192.168.2.4からの
アクセスは許可しない。
また、vsftpdは192.168.2.4からのアクセスは許可するが、192.168.2.3からのア
クセスは許可しないというぐあいである。

しかし、これはLibwrapサポートを受けるデーモン以外は対象にならないらしい…
(~ヘ〜;)ウーンわからん


トップへ