Linux设置主机访问IP限制

来源:互联网 发布:压缩文件密码破解软件 编辑:程序博客网 时间:2024/06/16 01:45
(1).执行备份:
#cp -p /etc/hosts.allow /etc/hosts.allow_bak
#cp -p /etc/hosts.deny /etc/hosts.deny_bak
(2).编辑/etc/hosts.allow文件,增加一行 service: 允许访问的IP(service为服务,例如sshd),举例如下:all:192.168.4.44:allow    #允许单个IP访问所有服务进程
sshd:192.168.1.:allow    #允许192.168.1的整个网段访问SSH服务进程
#编辑文件/etc/hosts.deny增加一行
all:all                            #拒绝一切远程访问配合文件hosts.allow使用.
0 0