Search code examples
pythoncentos6systemdfail2ban

Cant enable fail2ban jail sshd


When enabled sshd jail i see Starting fail2ban: ERROR NOK: ("Failed to initialize any backend for Jail 'sshd'",) ERROR NOK: ('sshd',) In logs : ERROR Backend 'systemd' failed to initialize due to No module named systemd ERROR Failed to initialize any backend for Jail 'sshd'

Centos 6.7 no have systemd module . CentOS 6.7, python 2.6


Solution

  • Just replace in you jail config backend to auto From

    [sshd]
    enabled = true
    filter = sshd
    port    = ssh
    logpath = %(sshd_log)s
    backend = %(sshd_backend)s
    

    To

    [sshd]
    enabled = true
    filter = sshd
    port    = ssh
    logpath = %(sshd_log)s
    backend = auto
    

    And restart service service fail2ban restart