this post was submitted on 07 May 2026
62 points (97.0% liked)

Selfhosted

59353 readers
627 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

  7. No low-effort posts. This is subjective and will largely be determined by the community member reports.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 3 years ago
MODERATORS
 

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
you are viewing a single comment's thread
view the rest of the comments
[–] Shimitar@downonthestreet.eu 15 points 1 week ago (3 children)

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 8 points 1 week 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 wire guard/tailscale for ssh access instead.

[–] i_am_not_a_robot@discuss.tchncs.de 4 points 1 week ago (2 children)

Root login and password authentication are already disabled, and it's very uncommon for self hosters to use SSH certificates at all.

Changing the SSH port away from 22 does not improve security unless your password is "password" or "admin". Anybody who's even slightly sophisticated will find your SSH service on the correct port and make requests there instead.

I don't think changing the port has the intention of better security here, just reduces the amount of requests that dumb bots make. It's noticable if you try it.

[–] Shimitar@downonthestreet.eu 7 points 1 week ago

Yes, I meant ssh private/public keys, not certificates ...

And changing the port reduces the amount of attempts in any case.

[–] possiblylinux127@lemmy.zip 1 points 1 week ago

I would use keys instead of certs