标签: denyhosts

  • Install DenyHosts on Linux VPS

    #!/bin/bash
    PKG_VER=2.10
    PKG_DIR=denyhosts-${PKG_VER}
    PKG_TAR=${PKG_DIR}.tar.gz
    PKG_URL=https://sourceforge.net/projects/denyhosts/files/denyhosts/${PKG_VER}

    rm ${PKG_TAR}
    rm -rf ${PKG_DIR}
    wget –no-check-certificate  ${PKG_URL}/${PKG_TAR}
    tar xvfz ${PKG_TAR}

    sudo mv ${PKG_DIR}/ /usr/share/denyhosts

    cd /usr/share/denyhosts/
    sudo cp denyhosts.conf /etc

    CFG=/etc/denyhosts.conf
    sudo sed -i “s/DENY_THRESHOLD_ROOT = 1/DENY_THRESHOLD_ROOT = 8/” ${CFG}
    sudo sed -i “s/ADMIN_EMAIL = root@localhost/ADMIN_EMAIL = /” ${CFG}

    sudo cp denyhosts.py /usr/sbin/denyhosts
    sudo mv daemon-control-dist daemon-control

    cd /etc/init.d
    sudo ln -s /usr/share/denyhosts/daemon-control denyhosts
    sudo touch /var/log/auth.log
    sudo update-rc.d denyhosts start
    sudo /etc/init.d/denyhosts start