20 quick tips to make Linux networking easier (2/20)

[复制链接]
Toolong 发表于 2020-2-19 15:15:21 | 显示全部楼层 |阅读模式
2: Keep out unwanted users with /etc/hosts.deny
Yet another helpful “hosts” file is hosts.deny. This file allows you to create access control based on client or
server names. This is helpful in many ways. You can block blacklist domains from gaining access to your
network or you can block certain users from gaining access to certain machines. But no matter how you use
it, the format is the same.
Let’s say you want to block the domain bad.domain.name from gaining access to a machine. To do this, open
up the /etc/hosts.deny file (you will need either root or sudo privileges) and add this to the bottom of the file:
ALL: bad.domain.name
Save it and you’re good to go.



上一篇:20 quick tips to make Linux networking easier (1/20)
下一篇:20 quick tips to make Linux networking easier (3/20)

本版积分规则

QQ|Archiver|手机版|小黑屋|个人研发笔记 京ICP备18037383号-1

GMT+8, 2020-12-1 23:37

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表