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) |