How to install denyhosts on Ubuntu Linux 18.04 LTS ( intrusion prevention security tool )

How to install denyhosts on Ubuntu Linux 18.04 LTS ( intrusion prevention security tool )

To install DenyHosts on Ubuntu 18.04 LTS, you can use the following steps:

  1. Install the dependencies for DenyHosts:
    sudo apt-get install python-paramiko python-pycrypto
    This installs the required Python libraries for DenyHosts.

  2. Download the DenyHosts tarball:
    wget https://sourceforge.net/projects/denyhosts/files/DenyHosts/2.6/DenyHosts-2.6.tar.gz
    This downloads the DenyHosts tarball to your current directory.

  3. Extract the tarball:
    tar xvf DenyHosts-2.6.tar.gz
    This extracts the DenyHosts files to a directory called DenyHosts-2.6.

  4. Change to the DenyHosts directory:
    cd DenyHosts-2.6

  5. Install DenyHosts:
    sudo python setup.py install
    This installs DenyHosts and creates a denyhosts.py command-line alias.

  6. Configure DenyHosts:
    sudo cp /usr/share/denyhosts/daemon-control-dist /etc/init.d/denyhosts
    sudo chmod +x /etc/init.d/denyhosts
    sudo cp /usr/share/denyhosts/denyhosts.cfg-dist /etc/denyhosts.cfg
    These commands create the DenyHosts configuration file and a daemon control script for starting and stopping DenyHosts.

  7. Edit the configuration file to customize the DenyHosts settings. The file is well-documented and contains instructions on how to configure the various options.

  8. Start DenyHosts:
    sudo /etc/init.d/denyhosts start

You can verify that DenyHosts is running by checking the status:
sudo /etc/init.d/denyhosts status

DenyHosts is a security tool that prevents brute-force attacks on your server by blocking the IP addresses of malicious attackers. It monitors log files for failed login attempts and automatically adds the IP addresses of the attackers to the /etc/hosts.deny file, which blocks them from accessing the server.

Note: These steps assume that you are using a Debian-based Linux distribution, such as Ubuntu. If you are using a different Linux distribution, you may need to use different commands to install and configure DenyHosts.

Created Time:2017-10-16 14:38:49  Author:lautturi