My YunoHost server
Hardware: VPS bought online
YunoHost version: 11.2.9.1 (stable)
I have access to my server : Through SSH | through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no
Description of my issue
Hi,
My system send regular messages as follows;
The automatic diagnosis on your YunoHost server identified some issues on your server. You will find a description of the issues below. You can manage those issues in the ‘Diagnosis’ section in your webadmin.
=================================
Base system (basesystem)
[WARNING] There’s been a suspiciously high number of authentication failures recently. You may want to make sure that fail2ban is running and is correctly configured, or use a custom port for SSH as explained in Security | Yunohost Documentation.
Diagnosis reports same issue.
Fail2ban service logs → hastebin
Save New Duplicate & Edit Just Text Twitter
LOGFILE: journalctl
-- Journal begins at Thu 2023-10-05 00:00:05 CEST, ends at Sat 2024-02-10 09:35:43 CET. --
Feb 10 09:17:19 fail2ban-server[28682]: self.__flushBan(stop=True)
Feb 10 09:17:19 fail2ban-server[28682]: File "/usr/lib/python3/dist-packages/fail2ban/server/actions.py", line 666, in __flushBan
Feb 10 09:17:19 fail2ban-server[28682]: action.consistencyCheck(_beforeRepair)
Feb 10 09:17:19 fail2ban-server[28682]: File "/usr/lib/python3/dist-packages/fail2ban/server/action.py", line 690, in consistencyCheck
Feb 10 09:17:19 fail2ban-server[28682]: if started and not self._invariantCheck(family, beforeRepair):
Feb 10 09:17:19 fail2ban-server[28682]: File "/usr/lib/python3/dist-packages/fail2ban/server/action.py", line 916, in _invariantCheck
Feb 10 09:17:19 fail2ban-server[28682]: if beforeRepair and not beforeRepair():
Feb 10 09:17:19 fail2ban-server[28682]: File "/usr/lib/python3/dist-packages/fail2ban/server/actions.py", line 663, in _beforeRepair
Feb 10 09:17:19 fail2ban-server[28682]: self._logSys.error("Invariant check failed. Flush is impossible.")
Feb 10 09:17:19 fail2ban-server[28682]: AttributeError: 'Actions' object has no attribute '_logSys'
Feb 10 09:17:20 fail2ban-client[29215]: Shutdown successful
Feb 10 09:17:20 systemd[1]: fail2ban.service: Succeeded.
Feb 10 09:17:20 systemd[1]: Stopped Fail2Ban Service.
Feb 10 09:17:20 systemd[1]: fail2ban.service: Consumed 1.883s CPU time.
Feb 10 09:17:20 systemd[1]: Starting Fail2Ban Service...
Feb 10 09:17:20 systemd[1]: Started Fail2Ban Service.
Feb 10 09:17:20 fail2ban-server[29222]: Server ready
Feb 10 09:18:35 systemd[1]: Reloading Fail2Ban Service.
Feb 10 09:18:35 fail2ban-client[29420]: OK
Feb 10 09:18:35 systemd[1]: Reloaded Fail2Ban Service.
Feb 10 09:18:36 systemd[1]: Stopping Fail2Ban Service...
Feb 10 09:18:37 fail2ban-server[29222]: Traceback (most recent call last):
Feb 10 09:18:37 fail2ban-server[29222]: File "/usr/lib/python3/dist-packages/fail2ban/server/actions.py", line 653, in __flushBan
Feb 10 09:18:37 fail2ban-server[29222]: if action.flush():
Feb 10 09:18:37 fail2ban-server[29222]: File "/usr/lib/python3/dist-packages/fail2ban/server/action.py", line 637, in flush
Feb 10 09:18:37 fail2ban-server[29222]: return self._executeOperation('<actionflush>', 'flushing', family=family, afterExec=_afterFlush)
Feb 10 09:18:37 fail2ban-server[29222]: File "/usr/lib/python3/dist-packages/fail2ban/server/action.py", line 476, in _executeOperation
Feb 10 09:18:37 fail2ban-server[29222]: raise RuntimeError("Error %s action %s/%s: %r" % (operation, self._jail, self._name, err))
Feb 10 09:18:37 fail2ban-server[29222]: RuntimeError: Error flushing action Jail('recidive')/iptables-allports: 'Script error'
Feb 10 09:18:37 fail2ban-server[29222]: During handling of the above exception, another exception occurred:
Feb 10 09:18:37 fail2ban-server[29222]: Traceback (most recent call last):
Feb 10 09:18:37 fail2ban-server[29222]: File "/usr/lib/python3/dist-packages/fail2ban/server/jailthread.py", line 69, in run_with_except_hook
Feb 10 09:18:37 fail2ban-server[29222]: run(*args, **kwargs)
Feb 10 09:18:37 fail2ban-server[29222]: File "/usr/lib/python3/dist-packages/fail2ban/server/actions.py", line 368, in run
Feb 10 09:18:37 fail2ban-server[29222]: self.__flushBan(stop=True)
Feb 10 09:18:37 fail2ban-server[29222]: File "/usr/lib/python3/dist-packages/fail2ban/server/actions.py", line 666, in __flushBan
Feb 10 09:18:37 fail2ban-server[29222]: action.consistencyCheck(_beforeRepair)
Feb 10 09:18:37 fail2ban-server[29222]: File "/usr/lib/python3/dist-packages/fail2ban/server/action.py", line 690, in consistencyCheck
Feb 10 09:18:37 fail2ban-server[29222]: if started and not self._invariantCheck(family, beforeRepair):
Feb 10 09:18:37 fail2ban-server[29222]: File "/usr/lib/python3/dist-packages/fail2ban/server/action.py", line 916, in _invariantCheck
Feb 10 09:18:37 fail2ban-server[29222]: if beforeRepair and not beforeRepair():
Feb 10 09:18:37 fail2ban-server[29222]: File "/usr/lib/python3/dist-packages/fail2ban/server/actions.py", line 663, in _beforeRepair
Feb 10 09:18:37 fail2ban-server[29222]: self._logSys.error("Invariant check failed. Flush is impossible.")
Feb 10 09:18:37 fail2ban-server[29222]: AttributeError: 'Actions' object has no attribute '_logSys'
Feb 10 09:18:37 fail2ban-client[29513]: Shutdown successful
Feb 10 09:18:37 systemd[1]: fail2ban.service: Succeeded.
Feb 10 09:18:37 systemd[1]: Stopped Fail2Ban Service.
Feb 10 09:18:37 systemd[1]: Starting Fail2Ban Service...
Feb 10 09:18:37 systemd[1]: Started Fail2Ban Service.
Feb 10 09:18:38 fail2ban-server[29520]: Server ready
LOGFILE: /var/log/fail2ban.log
2024-02-10 09:34:15,120 fail2ban.filter [29520]: INFO [sshd] Found 138.197.31.240 - 2024-02-10 09:34:15
2024-02-10 09:34:15,125 fail2ban.filter [29520]: INFO [pam-generic] Found 138.197.31.240 - 2024-02-10 09:34:15
2024-02-10 09:34:15,589 fail2ban.filter [29520]: INFO [sshd] Found 109.123.239.236 - 2024-02-10 09:34:15
2024-02-10 09:34:15,593 fail2ban.filter [29520]: INFO [pam-generic] Found 109.123.239.236 - 2024-02-10 09:34:15
2024-02-10 09:34:17,198 fail2ban.filter [29520]: INFO [sshd] Found 138.197.31.240 - 2024-02-10 09:34:16
2024-02-10 09:34:17,438 fail2ban.filter [29520]: INFO [sshd] Found 109.123.239.236 - 2024-02-10 09:34:17
2024-02-10 09:34:24,824 fail2ban.filter [29520]: INFO [sshd] Found 35.186.145.141 - 2024-02-10 09:34:24
2024-02-10 09:34:24,830 fail2ban.filter [29520]: INFO [pam-generic] Found 35.186.145.141 - 2024-02-10 09:34:24
2024-02-10 09:34:26,911 fail2ban.filter [29520]: INFO [sshd] Found 35.186.145.141 - 2024-02-10 09:34:26
2024-02-10 09:34:29,215 fail2ban.filter [29520]: INFO [pam-generic] Found 185.45.212.231 - 2024-02-10 09:34:29
2024-02-10 09:34:29,216 fail2ban.filter [29520]: INFO [sshd] Found 185.45.212.231 - 2024-02-10 09:34:28
2024-02-10 09:34:30,621 fail2ban.filter [29520]: INFO [pam-generic] Found 185.74.4.20 - 2024-02-10 09:34:30
2024-02-10 09:34:30,622 fail2ban.filter [29520]: INFO [sshd] Found 185.74.4.20 - 2024-02-10 09:34:30
2024-02-10 09:34:30,626 fail2ban.filter [29520]: INFO [sshd] Found 185.45.212.231 - 2024-02-10 09:34:30
2024-02-10 09:34:32,352 fail2ban.filter [29520]: INFO [sshd] Found 185.74.4.20 - 2024-02-10 09:34:32
2024-02-10 09:34:46,789 fail2ban.filter [29520]: INFO [pam-generic] Found 129.204.224.239 - 2024-02-10 09:34:46
2024-02-10 09:34:46,791 fail2ban.filter [29520]: INFO [sshd] Found 129.204.224.239 - 2024-02-10 09:34:46
2024-02-10 09:34:46,934 fail2ban.filter [29520]: INFO [sshd] Found 43.134.119.233 - 2024-02-10 09:34:46
2024-02-10 09:34:46,937 fail2ban.filter [29520]: INFO [pam-generic] Found 43.134.119.233 - 2024-02-10 09:34:46
2024-02-10 09:34:48,078 fail2ban.filter [29520]: INFO [sshd] Found 129.204.224.239 - 2024-02-10 09:34:48
2024-02-10 09:34:48,369 fail2ban.filter [29520]: INFO [sshd] Found 43.134.119.233 - 2024-02-10 09:34:48
2024-02-10 09:34:48,534 fail2ban.actions [29520]: NOTICE [sshd] Ban 129.204.224.239
2024-02-10 09:34:48,541 fail2ban.filter [29520]: INFO [recidive] Found 129.204.224.239 - 2024-02-10 09:34:48
2024-02-10 09:34:52,276 fail2ban.filter [29520]: INFO [sshd] Found 59.89.163.65 - 2024-02-10 09:34:52
2024-02-10 09:34:52,278 fail2ban.filter [29520]: INFO [pam-generic] Found 59.89.163.65 - 2024-02-10 09:34:52
2024-02-10 09:34:52,626 fail2ban.filter [29520]: INFO [sshd] Found 43.134.25.163 - 2024-02-10 09:34:52
2024-02-10 09:34:52,628 fail2ban.filter [29520]: INFO [pam-generic] Found 43.134.25.163 - 2024-02-10 09:34:52
2024-02-10 09:34:53,476 fail2ban.filter [29520]: INFO [sshd] Found 59.89.163.65 - 2024-02-10 09:34:53
2024-02-10 09:34:53,887 fail2ban.filter [29520]: INFO [sshd] Found 43.134.25.163 - 2024-02-10 09:34:53
2024-02-10 09:34:55,955 fail2ban.filter [29520]: INFO [sshd] Found 43.135.177.244 - 2024-02-10 09:34:55
2024-02-10 09:34:55,957 fail2ban.filter [29520]: INFO [pam-generic] Found 43.135.177.244 - 2024-02-10 09:34:55
2024-02-10 09:34:57,162 fail2ban.actions [29520]: NOTICE [sshd] Unban 103.123.63.250
2024-02-10 09:34:58,663 fail2ban.filter [29520]: INFO [sshd] Found 43.135.177.244 - 2024-02-10 09:34:58
2024-02-10 09:35:06,707 fail2ban.filter [29520]: INFO [pam-generic] Found 138.197.31.240 - 2024-02-10 09:35:06
2024-02-10 09:35:06,709 fail2ban.filter [29520]: INFO [sshd] Found 138.197.31.240 - 2024-02-10 09:35:06
2024-02-10 09:35:09,413 fail2ban.filter [29520]: INFO [sshd] Found 138.197.31.240 - 2024-02-10 09:35:09
2024-02-10 09:35:17,834 fail2ban.filter [29520]: INFO [sshd] Found 109.123.239.236 - 2024-02-10 09:35:17
2024-02-10 09:35:17,836 fail2ban.filter [29520]: INFO [pam-generic] Found 109.123.239.236 - 2024-02-10 09:35:17
2024-02-10 09:35:19,122 fail2ban.filter [29520]: INFO [sshd] Found 35.186.145.141 - 2024-02-10 09:35:19
2024-02-10 09:35:19,125 fail2ban.filter [29520]: INFO [pam-generic] Found 35.186.145.141 - 2024-02-10 09:35:19
2024-02-10 09:35:19,525 fail2ban.filter [29520]: INFO [sshd] Found 109.123.239.236 - 2024-02-10 09:35:19
2024-02-10 09:35:21,474 fail2ban.filter [29520]: INFO [sshd] Found 35.186.145.141 - 2024-02-10 09:35:21
2024-02-10 09:35:29,048 fail2ban.filter [29520]: INFO [sshd] Found 185.74.4.20 - 2024-02-10 09:35:29
2024-02-10 09:35:29,051 fail2ban.filter [29520]: INFO [pam-generic] Found 185.74.4.20 - 2024-02-10 09:35:29
2024-02-10 09:35:31,756 fail2ban.filter [29520]: INFO [sshd] Found 185.74.4.20 - 2024-02-10 09:35:31
2024-02-10 09:35:32,562 fail2ban.filter [29520]: INFO [sshd] Found 185.45.212.231 - 2024-02-10 09:35:32
2024-02-10 09:35:32,566 fail2ban.filter [29520]: INFO [pam-generic] Found 185.45.212.231 - 2024-02-10 09:35:32
2024-02-10 09:35:34,983 fail2ban.filter [29520]: INFO [sshd] Found 185.45.212.231 - 2024-02-10 09:35:34
2024-02-10 09:35:35,223 fail2ban.actions [29520]: NOTICE [sshd] Ban 185.45.212.231
2024-02-10 09:35:35,271 fail2ban.filter [29520]: INFO [recidive] Found 185.45.212.231 - 2024-02-10 09:35:35
When I try to change ssh port number everything looks like good but old port persist. I tried to change both cli and via webadmin but failed.
What is my sytem’s problem. How can solve it?
Thanks for your attention.
PS: I have another same two instances on different servers run as expected.