linux限制ip访问
- linux
- 2024-05-24 03:23:33
- 6620
⑴linux怎么禁止ip直接访问服务器
/etc/hosts.allow和/etc/hosts.deny这两个文件控制远程访问设置通过设置这些文件,您可以允许或拒绝特定IP或IP范围的客户端访问特定Linux服务。
如果请求访问的主机名或IP未包含在/etc/hosts.allow中,则tcpd进程会检查/etc/hosts.deny。
检查hosts.deny文件中是否包含请求访问的主机名或IP。
如果包含,则拒绝访问;如果未包含在/etc/hosts.allow或/etc/hosts.deny中,则允许访问。
文件格式为::[: