Автор Тема: Fail2ban на Centos 7  (Прочитано 4123 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн goro

  • Старожил
  • ****
  • Сообщений: 512
  • Рейтинг: 0
  • Пол: Мужской
    • romeo_2205
    • Просмотр профиля
  • Откуда: Киев
Fail2ban на Centos 7
« : 14 сентября 2016, 13:57:29 »
Добрый день.
На Centos 7 из epel инсталлировал  Fail2ban.
правлю файл /etc/fail2ban/jail.local
расскоментировал
[sshd]
enable = true
перезапускаю fail2ban

получаю

Job for fail2ban.service failed because the control process exited with error code. See "systemctl status fail2ban.service" and "journalctl -xe" for details.

journalctl -xe

Спойлер для скрыто:
Сен 14 13:55:54 Asterisk-test.mk.corp systemd[1]: Starting Fail2Ban Service...
-- Subject: Начинается запуск юнита fail2ban.service
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Начат процесс запуска юнита fail2ban.service.
Сен 14 13:55:54 Asterisk-test.mk.corp fail2ban-client[6282]: ERROR  Failed during configuration: File contains no section headers.
Сен 14 13:55:54 Asterisk-test.mk.corp fail2ban-client[6282]: file: /etc/fail2ban/jail.local, line: 30
Сен 14 13:55:54 Asterisk-test.mk.corp fail2ban-client[6282]: 'enabled = true\n'
Сен 14 13:55:54 Asterisk-test.mk.corp systemd[1]: fail2ban.service: control process exited, code=exited status=255
Сен 14 13:55:54 Asterisk-test.mk.corp systemd[1]: Failed to start Fail2Ban Service.
-- Subject: Ошибка юнита fail2ban.service
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Произошел сбой юнита fail2ban.service.
--
-- Результат: failed.
Сен 14 13:55:54 Asterisk-test.mk.corp systemd[1]: Unit fail2ban.service entered failed state.
Сен 14 13:55:54 Asterisk-test.mk.corp systemd[1]: fail2ban.service failed.
Сен 14 13:55:54 Asterisk-test.mk.corp systemd[1]: fail2ban.service holdoff time over, scheduling restart.
Сен 14 13:55:54 Asterisk-test.mk.corp systemd[1]: Starting Fail2Ban Service...
-- Subject: Начинается запуск юнита fail2ban.service
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Начат процесс запуска юнита fail2ban.service.
Сен 14 13:55:54 Asterisk-test.mk.corp fail2ban-client[6284]: ERROR  Failed during configuration: File contains no section headers.
Сен 14 13:55:54 Asterisk-test.mk.corp fail2ban-client[6284]: file: /etc/fail2ban/jail.local, line: 30
Сен 14 13:55:54 Asterisk-test.mk.corp fail2ban-client[6284]: 'enabled = true\n'
Сен 14 13:55:54 Asterisk-test.mk.corp systemd[1]: fail2ban.service: control process exited, code=exited status=255
Сен 14 13:55:54 Asterisk-test.mk.corp systemd[1]: Failed to start Fail2Ban Service.
-- Subject: Ошибка юнита fail2ban.service
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Произошел сбой юнита fail2ban.service.
--
-- Результат: failed.
Сен 14 13:55:54 Asterisk-test.mk.corp systemd[1]: Unit fail2ban.service entered failed state.
Сен 14 13:55:54 Asterisk-test.mk.corp systemd[1]: fail2ban.service failed.
Сен 14 13:55:54 Asterisk-test.mk.corp systemd[1]: fail2ban.service holdoff time over, scheduling restart.
Сен 14 13:55:54 Asterisk-test.mk.corp systemd[1]: Starting Fail2Ban Service...
-- Subject: Начинается запуск юнита fail2ban.service
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Начат процесс запуска юнита fail2ban.service.
Сен 14 13:55:54 Asterisk-test.mk.corp fail2ban-client[6286]: ERROR  Failed during configuration: File contains no section headers.
Сен 14 13:55:54 Asterisk-test.mk.corp fail2ban-client[6286]: file: /etc/fail2ban/jail.local, line: 30
Сен 14 13:55:54 Asterisk-test.mk.corp fail2ban-client[6286]: 'enabled = true\n'
Сен 14 13:55:54 Asterisk-test.mk.corp systemd[1]: fail2ban.service: control process exited, code=exited status=255
Сен 14 13:55:54 Asterisk-test.mk.corp systemd[1]: Failed to start Fail2Ban Service.
-- Subject: Ошибка юнита fail2ban.service
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Произошел сбой юнита fail2ban.service.
--
-- Результат: failed.
Сен 14 13:55:54 Asterisk-test.mk.corp systemd[1]: Unit fail2ban.service entered failed state.
Сен 14 13:55:54 Asterisk-test.mk.corp systemd[1]: fail2ban.service failed.
Сен 14 13:55:54 Asterisk-test.mk.corp systemd[1]: fail2ban.service holdoff time over, scheduling restart.
Сен 14 13:55:54 Asterisk-test.mk.corp systemd[1]: start request repeated too quickly for fail2ban.service
Сен 14 13:55:54 Asterisk-test.mk.corp systemd[1]: Failed to start Fail2Ban Service.
-- Subject: Ошибка юнита fail2ban.service
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Произошел сбой юнита fail2ban.service.
--
-- Результат: failed.
Сен 14 13:55:54 Asterisk-test.mk.corp systemd[1]: Unit fail2ban.service entered failed state.
Сен 14 13:55:54 Asterisk-test.mk.corp systemd[1]: fail2ban.service failed.



Где собака зарыта?

Оффлайн paxa_amo

  • Начинающий
  • *
  • Сообщений: 30
  • Рейтинг: 2
    • Просмотр профиля
  • Откуда: Миасс
Fail2ban на Centos 7
« Ответ #1 : 17 сентября 2016, 22:23:46 »
Надо не enable, а enabled.
Примерно так

[sshd]
enabled = true
port    = ssh
logpath = %(sshd_log)s
action = iptables-allports[name=sshd,protocol=all]
maxretry = 5
findtime = 86400
bantime = 86400