安装denyhosts在centos

denyhosts在debian上本来就有,不过在centos里就没有了,要自己装。

先下载rpm包

http://sourceforge.net/projects/denyhosts/files/

下载最新版本的rpm包,但是要注意当前机器上的python是什么版本,一定要相对应。

安装后,在/usr/share/denyhosts里有配置文件

cp denyhosts.cfg-dist denyhosts.cfg
ln -s /usr/share/denyhosts/daemon-control-dist /etc/init.d/denyhosts

denyhosts.cfg里实际上没有很多需要配置的,关键是用哪个log,一开头那个,后面就是一些细调,比如几次错误密码就阻止掉之类的。

chkconfig denyhosts on

加入到启动服务里

service denyhosts start

启动

凡是阻止的ip都会加到 /etc/hosts.deny里,如果有误加的就从这里删除。缺省是阻止sshd服务

猜你喜欢

转载自magicgod.iteye.com/blog/769497
今日推荐