Fail2Ban not installed, big security issue!
See original GitHub issueHi
I just wanted to add that when SSH is publicly accessible, especially when the bitcoin and lightning node is exposed. SSH access should be properly protected.
by simply running:
sudo apt-get install fail2ban
A service that IP ban computers for 10 minutes that attempt too many failed login attempts is automatically set up.
After setting this up myself my log showed:
tail -f /var/log/fail2ban.log
2018-08-08 09:05:13,556 fail2ban.filter [31984]: INFO [sshd] Found 121.18.238.123 - 2018-08-08 09:05:13
2018-08-08 09:05:16,261 fail2ban.filter [31984]: INFO [sshd] Found 121.18.238.123 - 2018-08-08 09:05:15
2018-08-08 09:05:26,252 fail2ban.filter [31984]: INFO [sshd] Found 121.18.238.123 - 2018-08-08 09:05:25
2018-08-08 09:05:28,957 fail2ban.filter [31984]: INFO [sshd] Found 121.18.238.123 - 2018-08-08 09:05:28
2018-08-08 09:05:39,332 fail2ban.filter [31984]: INFO [sshd] Found 121.18.238.123 - 2018-08-08 09:05:31
2018-08-08 09:05:39,826 fail2ban.actions [31984]: NOTICE [sshd] Ban 121.18.238.123
As you can see an Chinese IP address has been attempting to log in every couple of seconds for god knows how long. As soon as I installed Fail2Ban this IP was banned from access.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (10 by maintainers)
Top Results From Across the Web
Fail2ban wont start - Security - FreePBX Community Forums
Hello All,. This doesn't work for me. I do have the /etc/fail2ban/filter.d/apache-api.conf. and am running: sysadmin | 15.0.21.75 | Enabled.
Read more >How To Protect SSH with Fail2Ban on Ubuntu 20.04
Step 1 — Installing Fail2ban Fail2ban is available in Ubuntu's software repositories. Begin by running the following commands as a non-root ...
Read more >How to install and use Fail2Ban for Security on Ubuntu
Fail2ban is a powerful security tool available in Ubuntu that allows you to automatically monitor log files and ban IP addresses if any ......
Read more >How to Install and Configure Fail2Ban to Secure Linux Server
This detailed guide teaches you what is Fail2Ban, how to configure it and how to use it for providing an additional layer of...
Read more >Problems setting fail2ban apache rules
If pyinotify is not installed, Fail2ban will use auto. # gamin: requires Gamin (a file alteration monitor) to be installed.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed with https://mastodon.social/@BTCPayServer/100541625451629987
If your server is protected by a secure passphrase (or, even better, has password access disabled and logins only using a private key), fail2ban and similar tools don’t add any security. However, the cryptographic setup for an SSH session (which happens before a passphrase is provided) is computationally expensive for both sides of the connection, so I’ve seen low-power computers (e.g. RPi version 1) CPUs overwhelmed by just by attempted passphrase brute forcing.
Fail2ban is a good and easy solution to this, although you do want to keep the ban time small in my experience—I’ve locked myself out of several systems before by, e.g., entering the wrong password several times in a row by accident. Another solution is requiring logins in sshd_config only using private keys (obviously after setting that up first), as I believe that will reject passphrase attempts before the expensive cryptographic setup starts.