centos 5.5 hosts.allow&hosts.deny
2010-09-06 12:11
399 查看
centos 5.5 hosts.allow&hosts.deny
这个两个文件均在/etc目录下,优先级为先检查hosts.deny,然后检查hosts.allow文件,后者设置可以超越前者的限制。
举例:
1.限制所有的ssh
除非从xxx.xxx.xxx.xxx----127上来
hosts.deny内容如下:
in.sshd:ALL
hosts.allow内容
in.sshd:xxx.xxx.xxx.xxx/netmask
2.封掉xxx.xxx.xxx.0—127的telnet
hosts.deny
in.sshd:xxx.xxx.xxx.0/255.255.255.xxx
3.限制所有人的TCP连接,除非从xxx.xxx.xxx.0——127访问
hosts.deny
ALL:ALL
hosts.allow
ALL:xxx.xxx.xxx.0/255.255.255.xxx
4.限制xxx.xxx.xxx.0——127对所有服务的访问
hosts.deny
ALL:xxx.xxx.xxx.0/255.255.255.xxx
其中冒号前面是TCP daemon的服务进程名称,通常系统
进程在/etc/inetd.conf中指定,比如in.ftpd,in.telnetd,in.sshd
其中IP地址范围的写法有若干中,主要的三种是:
1.网络地址——子网掩码方式:
xxx.xxx.xxx.0/255.255.255.xxx
2.网络地址方式
xxx.xxx.(为xxx.xxx打头的ip地址。)
3.缩略子网掩码方式,既数一数二进制子网掩码前面有多少个“1”比如:
xxx.xxx.xxx.0/255.255.255.xxx /218.64.87.0/24
设置好后,要重新启动
#service network restart
# /etc/rc.d/init.d/xinetd restart
# /etc/rc.d/init.d/network restart
本文出自 “有志者事竟成!” 博客,请务必保留此出处http://zh888.blog.51cto.com/1684752/387888
这个两个文件均在/etc目录下,优先级为先检查hosts.deny,然后检查hosts.allow文件,后者设置可以超越前者的限制。
举例:
1.限制所有的ssh
除非从xxx.xxx.xxx.xxx----127上来
hosts.deny内容如下:
in.sshd:ALL
hosts.allow内容
in.sshd:xxx.xxx.xxx.xxx/netmask
2.封掉xxx.xxx.xxx.0—127的telnet
hosts.deny
in.sshd:xxx.xxx.xxx.0/255.255.255.xxx
3.限制所有人的TCP连接,除非从xxx.xxx.xxx.0——127访问
hosts.deny
ALL:ALL
hosts.allow
ALL:xxx.xxx.xxx.0/255.255.255.xxx
4.限制xxx.xxx.xxx.0——127对所有服务的访问
hosts.deny
ALL:xxx.xxx.xxx.0/255.255.255.xxx
其中冒号前面是TCP daemon的服务进程名称,通常系统
进程在/etc/inetd.conf中指定,比如in.ftpd,in.telnetd,in.sshd
其中IP地址范围的写法有若干中,主要的三种是:
1.网络地址——子网掩码方式:
xxx.xxx.xxx.0/255.255.255.xxx
2.网络地址方式
xxx.xxx.(为xxx.xxx打头的ip地址。)
3.缩略子网掩码方式,既数一数二进制子网掩码前面有多少个“1”比如:
xxx.xxx.xxx.0/255.255.255.xxx /218.64.87.0/24
设置好后,要重新启动
#service network restart
# /etc/rc.d/init.d/xinetd restart
# /etc/rc.d/init.d/network restart
本文出自 “有志者事竟成!” 博客,请务必保留此出处http://zh888.blog.51cto.com/1684752/387888
相关文章推荐
- centos 安全配置应用之hosts.allow和hosts.deny
- centos 阶段复习 2015-4-6 dd命令 hosts.allow和hosts.deny 啊铭的myssh脚本 清空history命令历史 /dev/zero 零发生器 /dev/null 黑洞 /dev/random 生成随机数 第十一节课
- hosts.deny和hosts.allow限制SSH登陆的IP
- /etc/hosts.allow和/etc/hosts.deny的作用
- 提高Linux安全性--hosts.allow, hosts.deny 文件修改方法
- hosts.deny hosts.allow防止ssh暴力破解密码
- hosts.allow and hosts.deny
- linux下的hosts.allow和hosts.deny
- hosts.allow和hosts.deny文件
- Linux hosts.allow与hosts.deny文件设置
- Linux hosts.allow与hosts.deny文件设置
- 通过配置hosts.allow和hosts.deny文件允许或禁止ssh或telnet操作
- hosts.allow、hosts.deny无效查看服务是否支持tcp_Wrappers
- system-config-selinux & hosts.deny hosts.allow
- hosts.allow hosts.deny
- hosts.deny和hosts.allow 设置限制SSH登陆的IP
- hosts.allow/hosts.deny
- hosts.deny和hosts.allow 设置限制SSH登陆的IP
- Linux hosts.allow与hosts.deny文件设置
- centos使用denyhosts的问题,会将自己的IP自动加到hosts.deny的解决办法。