最近通过系统日志/var/log/secure 查看到很多IP通过sshd非法链接到服务器,为此,我发现了
DenyHosts工具
![](https://img-blog.csdnimg.cn/27f4c68925c945daa8f64a6e0dc7dfae.jpeg)
步骤:
tar zxvf DenyHosts-2.6.tar.gz
cd DenyHosts-2.6
python setup.py install
cd /usr/share/denyhosts/
cp denyhosts.cfg-dist denyhosts.cfg
cp daemon-control-dist daemon-control
通过配置denyhosts.cfg(http://blog.chinaunix.net/uid-26167002-id-3026491.html 如何配置)之后启动。
./daemon-control start
就有大量的IP被写入到/etc/hosts.deny,做到了一定性的预防.
![](https://img-blog.csdnimg.cn/ddd10926710045c28d07c83b3a03b3c4.jpeg)