Skip to main content

Linux: Install fail2ban

https://pixabay.com/photos/stop-shield-traffic-sign-road-sign-634941/

Install fail2ban on Fedora Workstation.

[tuyen@g73jh ~]$ sudo dnf -y install fail2ban
[sudo] password for tuyen: 
Last metadata expiration check: 0:01:15 ago on Mon 07 Oct 2019 11:33:47 AM +07.
Dependencies resolved.
================================================================================
 Package                  Architecture Version               Repository    Size
================================================================================
Installing:
 fail2ban                 noarch       0.10.4-3.fc30         fedora       8.9 k
Installing dependencies:
 esmtp                    x86_64       1.2-13.fc30           fedora        52 k
 fail2ban-firewalld       noarch       0.10.4-3.fc30         fedora       9.0 k
 fail2ban-sendmail        noarch       0.10.4-3.fc30         fedora        12 k
 fail2ban-server          noarch       0.10.4-3.fc30         fedora       398 k
 libesmtp                 x86_64       1.0.6-17.fc30         fedora        60 k
 liblockfile              x86_64       1.14-3.fc30           fedora        26 k

Transaction Summary
================================================================================
Install  7 Packages

Total download size: 566 k
Installed size: 1.6 M
Downloading Packages:
(1/7): fail2ban-0.10.4-3.fc30.noarch.rpm         36 kB/s | 8.9 kB     00:00    
(2/7): fail2ban-firewalld-0.10.4-3.fc30.noarch.  36 kB/s | 9.0 kB     00:00    
(3/7): fail2ban-sendmail-0.10.4-3.fc30.noarch.r 140 kB/s |  12 kB     00:00    
(4/7): esmtp-1.2-13.fc30.x86_64.rpm             139 kB/s |  52 kB     00:00    
(5/7): liblockfile-1.14-3.fc30.x86_64.rpm       264 kB/s |  26 kB     00:00    
(6/7): libesmtp-1.0.6-17.fc30.x86_64.rpm        309 kB/s |  60 kB     00:00    
(7/7): fail2ban-server-0.10.4-3.fc30.noarch.rpm 972 kB/s | 398 kB     00:00    
--------------------------------------------------------------------------------
Total                                           366 kB/s | 566 kB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1 
  Installing       : fail2ban-server-0.10.4-3.fc30.noarch                   1/7 
  Running scriptlet: fail2ban-server-0.10.4-3.fc30.noarch                   1/7 
  Installing       : fail2ban-firewalld-0.10.4-3.fc30.noarch                2/7 
  Installing       : liblockfile-1.14-3.fc30.x86_64                         3/7 
  Installing       : libesmtp-1.0.6-17.fc30.x86_64                          4/7 
  Installing       : esmtp-1.2-13.fc30.x86_64                               5/7 
  Running scriptlet: esmtp-1.2-13.fc30.x86_64                               5/7 
  Installing       : fail2ban-sendmail-0.10.4-3.fc30.noarch                 6/7 
  Installing       : fail2ban-0.10.4-3.fc30.noarch                          7/7 
  Running scriptlet: fail2ban-0.10.4-3.fc30.noarch                          7/7 
  Verifying        : esmtp-1.2-13.fc30.x86_64                               1/7 
  Verifying        : fail2ban-0.10.4-3.fc30.noarch                          2/7 
  Verifying        : fail2ban-firewalld-0.10.4-3.fc30.noarch                3/7 
  Verifying        : fail2ban-sendmail-0.10.4-3.fc30.noarch                 4/7 
  Verifying        : fail2ban-server-0.10.4-3.fc30.noarch                   5/7 
  Verifying        : libesmtp-1.0.6-17.fc30.x86_64                          6/7 
  Verifying        : liblockfile-1.14-3.fc30.x86_64                         7/7 

Installed:
  fail2ban-0.10.4-3.fc30.noarch                                                 
  esmtp-1.2-13.fc30.x86_64                                                      
  fail2ban-firewalld-0.10.4-3.fc30.noarch                                       
  fail2ban-sendmail-0.10.4-3.fc30.noarch                                        
  fail2ban-server-0.10.4-3.fc30.noarch                                          
  libesmtp-1.0.6-17.fc30.x86_64                                                 
  liblockfile-1.14-3.fc30.x86_64                                                

Complete!
[tuyen@g73jh ~]$ 

Start fail2ban service, check status, and enable started automatically.

[tuyen@g73jh ~]$ sudo systemctl start fail2ban
[tuyen@g73jh ~]$ sudo systemctl status fail2ban
● fail2ban.service - Fail2Ban Service
   Loaded: loaded (/usr/lib/systemd/system/fail2ban.service; disabled; vendor p>
   Active: active (running) since Mon 2019-10-07 11:37:57 +07; 2s ago
     Docs: man:fail2ban(1)
  Process: 5174 ExecStartPre=/bin/mkdir -p /var/run/fail2ban (code=exited, stat>
 Main PID: 5175 (fail2ban-server)
    Tasks: 1 (limit: 4915)
   Memory: 10.9M
   CGroup: /system.slice/fail2ban.service
           └─5175 /usr/bin/python3 -s /usr/bin/fail2ban-server -xf start

Oct 07 11:37:57 g73jh systemd[1]: Starting Fail2Ban Service...
Oct 07 11:37:57 g73jh systemd[1]: Started Fail2Ban Service.
Oct 07 11:37:57 g73jh fail2ban-server[5175]: Server ready
[tuyen@g73jh ~]$ sudo systemctl enable fail2ban
Created symlink /etc/systemd/system/multi-user.target.wants/fail2ban.service → /usr/lib/systemd/system/fail2ban.service.
[tuyen@g73jh ~]$ 

check fail2ban's log file: /var/log/fail2ban.log

[tuyen@g73jh ~]$ sudo tail /var/log/fail2ban.log 
[sudo] password for tuyen: 
2019-10-07 11:37:57,359 fail2ban.server         [5175]: INFO    --------------------------------------------------
2019-10-07 11:37:57,359 fail2ban.server         [5175]: INFO    Starting Fail2ban v0.10.4
2019-10-07 11:37:57,362 fail2ban.database       [5175]: INFO    Connected to fail2ban persistent database '/var/lib/fail2ban/fail2ban.sqlite3'
2019-10-07 11:37:57,364 fail2ban.database       [5175]: WARNING New database created. Version '2'
[tuyen@g73jh ~]$ 

Popular posts from this blog

Microsoft AI Shell: Notes

AI Shell

Linux command: lspci

Linux command: lspci - list pci devices tuyendq@ubuntu001:~$ man lspci NAME        lspci - list all PCI devices SYNOPSIS        lspci [options] DESCRIPTION        lspci is a utility for displaying information about PCI buses in the system and devices connected to them.        By  default,  it  shows a brief list of devices. Use the options described below to request either a more verbose output or output intended for parsing by        other programs.        If you are going to report bugs in PCI device drivers or in lspci itself, please include output of "lspci -vvx" or even better  "lspci  -vvxxx"  (however,        see below for possible caveats).        Some  parts of the output, especially in the highly verbose modes, are probably intelligible only to experienced PCI hac...

Vagrant: Notes

Vagrant is a tool for building and managing virtual machine environments in a single workflow. Download the latest version of Vagrant for your operating system at https://www.vagrantup.com/downloads.html