So it’s my first time setting up a VPS. Is it to be expected to ban 54 IPs over a 12h timespan? The real question for me is whether this is normal or too much.

$ sudo fail2ban-client status sshd
Status for the jail: sshd
|- Filter
|  |- Currently failed: 3
|  |- Total failed:     586
|  `- Journal matches:  _SYSTEMD_UNIT=ssh.service + _COMM=sshd
`- Actions
   |- Currently banned: 51
   |- Total banned:     54
   `- Banned IP list:   [list of IPs]

fail2ban sshd.conf

$ sudo cat /etc/fail2ban/jail.d/sshd.conf 
[sshd]
enabled = true
mode = aggressive
port = ssh
backend = systemd
maxretry = 3
findtime = 600
bantime = 86400

I have disabled SSH login via password. And only allow it over an SSH key.

$ sudo sshd -T | grep -E -i 'ChallengeResponseAuthentication|PasswordAuthentication|UsePAM|PermitRootLogin'
usepam no
permitrootlogin no
passwordauthentication no
  • pgo_lemmy@feddit.it
    link
    fedilink
    English
    arrow-up
    35
    ·
    7 days ago

    Normal background noise. ssh is a well known protocol/port and scanning is automated.

  • Possibly linux@lemmy.zip
    link
    fedilink
    English
    arrow-up
    8
    ·
    5 days ago

    I personally wouldn’t waste your time with bans

    Enable public key authentication and disable passwords

  • Shimitar@downonthestreet.eu
    link
    fedilink
    English
    arrow-up
    11
    ·
    6 days ago

    Yeah. Sounds about right.

    First of all disable root login over ssh. Second, move your ssh from port 22 to another port of your liking. Third, disable password authentication altogether and use only solid certificates.

    • Toribor@corndog.social
      link
      fedilink
      English
      arrow-up
      7
      ·
      edit-2
      6 days ago

      Switching SSH to a non-standard port can cut down on log noise but it doesn’t really help with security. It’s trivial to identify ssh running on any port and attackers typically do full port scans anyway.

      I’d put that effort towards allowlisting only trusted public ips or setting up wireguard/tailscale for ssh access instead.

  • mavu@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    2
    ·
    5 days ago

    imagine the modern internet like a school yard of a very large school during recess, and it has just snowed.

    Now imagine having ssh on port 22 as you a wearing a bright red wooly cap and standing in the middle of the yard jumping up and down and waving hands.

  • clb92@feddit.dk
    link
    fedilink
    English
    arrow-up
    6
    ·
    7 days ago

    Seems likely. Cheap VPSs are often used by beginners, so they’re prime targets for hackers. Known VPS IP-ranges probably get hammered constantly by hackers, who are hoping you set up a service temporarily without enabling any security, or perhaps with a weak temporary password of 1234 or something.

  • nonentity@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    3
    ·
    6 days ago

    Rookie numbers.

    My favourite f2b rule is the one strike ban on SSH root login attempts. Any IP originating a SSH root login attempt is clearly compromised, and gets black holed on all my hosts for a month.

    Note: direct SSH login isn’t permitted at all, the daemon is exposed purely to log the attempts.

      • nonentity@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        2
        ·
        6 days ago

        The actual span is a random period between 2 and 4 weeks, it’s interesting to watch how long it takes for attempts to resume.

        I prefer a more granular visibility, repeat offenders automagically ratchet up their stay in the sin bin.

        • Lka1988@lemmy.dbzer0.com
          link
          fedilink
          English
          arrow-up
          1
          ·
          6 days ago

          repeat offenders automagically ratchet up their stay in the sin bin.

          Now that is a glorious read first thing in the morning haha

  • Bloefz@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    7 days ago

    That’s not a lot even. I’ve seen much worse. Also with password disabled. Some idiot bots still try to send it whole password lists.

    Just move your SSH to another port, that is enough to get rid of most of the nuisance scans. Or allow SSH only on IPv6. That usually covers it (The IPv6 address space is too big to scan, unless you have a TLD directly pointing to your IPv6)

    What I personally do is run an overlay VPN like tailscale and allow SSH in only via that.

    • irmadlad@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      7 days ago

      What I personally do is run an overlay VPN like tailscale and allow SSH in only via that.

      Same. I use Tailscale as an overlay on the pFsense box and the server itself.

  • irmadlad@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    7 days ago

    Just 54? Those are rookie numbers bro. You need to open up a few more ports. LOL Honestly tho, seems pretty standard. You could change the SSH port which might lower some of the noise but bots now days are pretty sophisticated and it would be trivial to just scan your server and find out which port is SSH. If you want to stop tailing fail2ban nervously on the daily, you could use the hosts.allow/hosts.deny which would lock it down even further. Just remember to set host.allow first then host.deny. You could also deploy any number of secondary security packages like CrowdSec, Wazuh, et al.

  • Decronym@lemmy.decronym.xyzB
    link
    fedilink
    English
    arrow-up
    2
    arrow-down
    2
    ·
    edit-2
    3 days ago

    Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I’ve seen in this thread:

    Fewer Letters More Letters
    HTTP Hypertext Transfer Protocol, the Web
    HTTPS HTTP over SSL
    IP Internet Protocol
    SSH Secure Shell for remote terminal access
    SSL Secure Sockets Layer, for transparent encryption
    VPN Virtual Private Network
    VPS Virtual Private Server (opposed to shared hosting)

    5 acronyms in this thread; the most compressed thread commented on today has 7 acronyms.

    [Thread #278 for this comm, first seen 7th May 2026, 12:00] [FAQ] [Full list] [Contact] [Source code]