Chinaunix首页 | 论坛 | 博客
  • 博客访问: 26187845
  • 博文数量: 2065
  • 博客积分: 10377
  • 博客等级: 上将
  • 技术积分: 21525
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-04 17:50
文章分类

全部博文(2065)

文章存档

2012年(2)

2011年(19)

2010年(1160)

2009年(969)

2008年(153)

分类: LINUX

2010-08-26 09:32:28

我来说一下hosts.allow和hosts.deny的用处。

对于能过xinetd程序启动的网络服务,比如ftp telnet,我们就可以修改/etc/hosts.allow/etc/hosts.deny的配制,来许可或者拒绝哪些IP、主机、用户可以访问。

比如我们在/etc/hosts.allow中加入
all:218.24.129.
这样就会允许来自218.24.129.*域的所有的客户来访问。这只是举个例子,实际上,系统默认状态 下,都是能用这些网络服的

如果我们在/etc/hosts.deny中加入,就限制了来自218.24.129.*域的所有的所有的IP。
all:218.24.129.

如果我们在/etc/hosts.deny中加入
all:218.24.129.134,这样就限制了所有在218.24.129.134中的所有的用户的访问。

当hosts.allow和 host.deny相冲突时,以hosts.allow设置优化。

设置好后,要重新启动
# /etc/rc.d/init.d/xinetd restart
# /etc/rc.d/init.d/network restart
阅读(859) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~