Why am I seeing so many login attempts on my Raspberry Pi?
Asked by
lino.block
I'm running a website on my Raspberry Pi using nginx, and I keep noticing that my SSH terminal freezes frequently. After looking through my logs, I found tons of UFW blocks and messages about invalid user disconnectionsโit's happening multiple times per second! Is this something I should be worried about? I don't have much traffic on my site, could these login attempts be causing the lag in my terminal, or is that a separate issue? I'd really appreciate any insights on how to handle this.
Answers
If you're exposing services directly to the internet, that's a common risk. For your web server, just forward ports 80 and 443 and secure your configurations. If SSH is absolutely necessary, go with a non-standard port and definitely use fail2ban to safeguard against brute force attempts.
Reply to this answer
These login attempts are pretty standard when you expose SSH to the internet. Just to be safe, make sure you've disabled root logins, and configure your SSH to only allow key-based authentication. This makes it much harder for bots to gain access!
42 red stitches: And always remember to generate and manage your SSH keys carefully. Itโs easy to lock yourself out if youโre not careful.
Reply to this answer
It sounds like you might be dealing with a brute force attack. Exposing port 22 to the internet is risky. Consider installing fail2ban and switching to a different SSH port. These bots are constantly scanning and trying to guess passwords, so taking those precautions can help a lot!
gel+lane8: I've switched to a different SSH port and added fail2ban already. It really did reduce the attempts significantlyโnow I see only a few a minute!
!check the seals: Also, make sure you limit SSH access to known IPs if you can. That can help cut down on unwanted access attempts.
Reply to this answer
I recommend not exposing your Raspberry Pi directly. Instead, consider using cloud servicesโthey offer better security and backup support. Just leaving it out there can invite all sorts of unwanted traffic.
Reply to this answer
Definitely install fail2ban and change your SSH port. Running SSH on a non-standard port can help avoid most bots. Also, you might want to tweak iptables or UFW rules to block malicious requests completely. Just donโt accidentally lock yourself out!
ALMOST CERTAIN: Exactly! And even if you use a different port, make sure you're aware that determined attackers will still scan for it.
Reply to this answer
Add your answer
Answers are reviewed before publication.
sleeve+placket: Totally! I've been using fail2ban, and it really helpsโthe fewer attempts you see over time.