DenyHosts阻止SSH暴力破解
2012-11-12 12:29
483 查看
在/var/log/secure文件中,发现经常有人在试图破解登录密码,在网上找到了这个denyhosts工具,个人也测试了,感觉还是挺不错的。现把安装步骤贡献出来,也为了以后查询。
安装环境:centos5.5 x86
1.下载并解压DenyHosts源码包
[root@www ~]#wget http://sourceforge.net/projects/denyhosts/files/denyhosts/2.6/DenyHosts-2.6.tar.gz [root@www ~]#tar zxvf DenyHosts-2.6.tar.gz
[root@www ~]#cd DenyHosts-2.6
[root@www DenyHosts-2.6]#python setup.py install
2.开始安装
[root@www DenyHosts-2.6]#cd /usr/share/denyhosts/
[root@www denyhosts]#cp daemon-control-dist daemon-control
[root@www denyhosts]#chown root daemon-control
[root@www denyhosts]#chmod 700 daemon-control
[root@www denyhosts]#grep -v "^#" denyhosts.cfg-dist > denyhosts.cfg
3.编辑配置文件
[root@www denyhosts]#vi denyhosts.cfg
SECURE_LOG = /var/log/secure
HOSTS_DENY = /etc/hosts.deny
#控制用户登陆的文件
PURGE_DENY = 5m
#过多久后清除已经禁止的
BLOCK_SERVICE = sshd
#禁止的服务名
DENY_THRESHOLD_INVALID = 1
#允许无效用户失败的次数
DENY_THRESHOLD_VALID = 10
#允许普通用户登陆失败的次数
DENY_THRESHOLD_ROOT = 5
#允许root登陆失败的次数
HOSTNAME_LOOKUP=NO
#是否做域名反解
[root@www denyhosts]#cd /etc/init.d/
[root@www init.d]#ln -s /usr/share/denyhosts/daemon-control denyhosts
[root@www init.d]#chkconfig --add denyhosts
[root@www init.d]#chkconfig --level 345 denyhosts on
[root@www init.d]#/etc/init.d/denyhosts restart
echo "/usr/share/denyhosts/daemon-control start" >> /etc/rc.local
安装环境:centos5.5 x86
1.下载并解压DenyHosts源码包
[root@www ~]#wget http://sourceforge.net/projects/denyhosts/files/denyhosts/2.6/DenyHosts-2.6.tar.gz [root@www ~]#tar zxvf DenyHosts-2.6.tar.gz
[root@www ~]#cd DenyHosts-2.6
[root@www DenyHosts-2.6]#python setup.py install
2.开始安装
[root@www DenyHosts-2.6]#cd /usr/share/denyhosts/
[root@www denyhosts]#cp daemon-control-dist daemon-control
[root@www denyhosts]#chown root daemon-control
[root@www denyhosts]#chmod 700 daemon-control
[root@www denyhosts]#grep -v "^#" denyhosts.cfg-dist > denyhosts.cfg
3.编辑配置文件
[root@www denyhosts]#vi denyhosts.cfg
SECURE_LOG = /var/log/secure
HOSTS_DENY = /etc/hosts.deny
#控制用户登陆的文件
PURGE_DENY = 5m
#过多久后清除已经禁止的
BLOCK_SERVICE = sshd
#禁止的服务名
DENY_THRESHOLD_INVALID = 1
#允许无效用户失败的次数
DENY_THRESHOLD_VALID = 10
#允许普通用户登陆失败的次数
DENY_THRESHOLD_ROOT = 5
#允许root登陆失败的次数
HOSTNAME_LOOKUP=NO
#是否做域名反解
[root@www denyhosts]#cd /etc/init.d/
[root@www init.d]#ln -s /usr/share/denyhosts/daemon-control denyhosts
[root@www init.d]#chkconfig --add denyhosts
[root@www init.d]#chkconfig --level 345 denyhosts on
[root@www init.d]#/etc/init.d/denyhosts restart
echo "/usr/share/denyhosts/daemon-control start" >> /etc/rc.local
相关文章推荐
- DenyHosts 阻止SSH暴力破解最好的方法
- DenyHosts 阻止SSH暴力破解最好的方法
- 安装DenyHosts阻止SSH暴力破解
- 使用DenyHosts 阻止SSH暴力破解
- 最好的阻止SSH暴力破解的方法(DenyHosts)
- 使用DenyHosts阻止SSH暴力破解
- Linux下使用DenyHosts,阻止SSH暴力破解
- 最好的阻止SSH暴力破解的方法(DenyHosts)
- 使用DenyHosts阻止SSH暴力破解
- Linux 上DenyHosts阻止SSH暴力攻击
- Linux服务器ssh暴力破解-denyhosts解决详解
- fail2ban阻止SSH和VSFTP暴力破解密码
- 利用fail2ban阻止ssh暴力破解密码
- fail2ban阻止SSH和VSFTP暴力破解密码
- centos 7 DenyHosts 安装 防暴力破解ssh登陆
- linux服务器不得不注意的安全问题--ssh暴力破解--denyhosts解决
- Linux服务器ssh暴力破解-denyhosts解决详解
- Linux服务器应注意的安全问题-ssh暴力破解--denyhosts解决
- 部署DenyHosts防SSH暴力破解
- linux服务器不得不注意的安全问题--ssh暴力破解--denyhosts解决