首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >没有应用Linux hosts.deny设置。

没有应用Linux hosts.deny设置。
EN

Unix & Linux用户
提问于 2014-08-09 12:40:46
回答 1查看 737关注 0票数 0

我想让一堆网站在我的电脑上无法访问。

我的hosts.allow文件:

代码语言:javascript
复制
sendmail: all
# /etc/hosts.allow: list of hosts that are allowed to access the system.
#                   See the manual pages hosts_access(5) and hosts_options(5).
#
# Example:    ALL: LOCAL @some_netgroup
#             ALL: .foobar.edu EXCEPT terminalserver.foobar.edu
#
# If you're going to protect the portmapper use the name "rpcbind" for the
# daemon name. See rpcbind(8) and rpc.mountd(8) for further information.

我的hosts.deny文件:

代码语言:javascript
复制
# /etc/hosts.deny: list of hosts that are allowed to access the system.
#                  See the manual pages hosts_access(5) and hosts_options(5).
#
# Example:    ALL: some.host.name, .some.domain
#             ALL EXCEPT in.fingerd: other.host.name, .other.domain
#
# If you're going to protect the portmapper use the name "rpcbind" for the
# daemon name. See rpcbind(8) and rpc.mountd(8) for further information.
#
# The PARANOID wildcard matches any host whose name does not match its
# address.
#
# You may wish to enable this to ensure any programs that don't
# validate looked up hostnames still leave understandable logs. In past
# versions of Debian this has been the default.
# ALL: PARANOID

ALL: .vk.com
ALL: .ria.ru
ALL: facebook.com

我的hosts文件:

代码语言:javascript
复制
127.0.0.1   localhost
127.0.0.1:82 testsecond
127.0.1.1   shc
127.0.2.2:81  someth.com
127.0.2.2:83 test

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
fe00::0 ip6-mcastprefix
fe02::1 ip6-allnodes
fe02::2 ip6-allrouters

我确实遵循所有关于设置主机*文件的建议,而且我仍然可以访问它们。我必须做些愚蠢或错误的事。

对我来说,他们似乎被忽视了。

EN

回答 1

Unix & Linux用户

回答已采纳

发布于 2014-08-09 12:44:51

hosts.deny用于服务器,而不是在计算机上运行的客户端,因此您不能用它阻止网站。我建议为您的系统阅读hosts_access(5)手册页(Debian版本,FreeBSD版本)。

顺便说一句,伦纳特·波特林( Lennart Poettering )在费多拉( Fedora )提出了一项建议,摆脱tcpwrappers/tcpdOpenSSH也会这样做。

票数 3
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/149394

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档