在使用云服务器时,很容易受到攻击,为了避免被人恶意攻击可以安装denyhosts。
快速安装denyhosts,使用root登录,直接将下面的脚本拷入终端执行,OK。
wget https://github.com/denyhosts/denyhosts/archive/refs/tags/v2.10.tar.gz
tar xzvf v2.10.tar.gz
mv denyhosts-2.10/ /usr/share/denyhosts
cd /usr/share/denyhosts/
cp denyhosts.conf /etc
cp denyhosts.py /usr/sbin/denyhosts
mv daemon-control-dist daemon-control
cd /etc/init.d
ln -s /usr/share/denyhosts/daemon-control denyhosts
touch /var/log/auth.log
chkconfig denyhosts on
systemctl start denyhosts