To mitigate the effort to maintain my personal server, I am considering to only expose ssh port to the outside and use its socks proxy to reach other services. is Portknocking enough to reduce surface of attack to the minimum?

In your SSH config, you should disallow root login and password authentication.

It is more secure than these tommyknockers :-) but you can do that additionally, if you feel like it.

dalz
link
fedilink
-71Y

Why disallow root login? I always need root when I connect, and stealing the password by aliasing sudo/doas is trivial. It seems to me it would just make life harder for no benefit.

this_is_router
link
fedilink
English
311Y

Because then:

  • you also need to know the correct username
  • audits and logging shows which user used sudo to gain root access
@ShortN0te@lemmy.ml
link
fedilink
English
-211Y
  • you also need to know the correct username

Use a secure password or key. Security by obscurity is no security.

  • audits and logging shows which user used sudo to gain root access

That is not the point that was made. Once access to sudo or root you already have lost.

Security though obscurity, BY ITSELF, is not security. But it’s great at slowing attackers and thwarting automated scripts.

It’s bad security to ignore possible mitigations to a problem just because it isn’t as full fix.

@False@lemmy.world
link
fedilink
English
20
edit-2
1Y

You’re making it that much easier for someone to brute force logging in or to exploit a known vulnerability. If you have a separate root password (which you should) an attacker needs to get through two passwords to do anything privileged.

This has been considered an accepted best practice for 20+ years and there’s little reason not to do it anyways. You shouldn’t be running things as root directly regardless.

@ShortN0te@lemmy.ml
link
fedilink
English
-41Y

When you have secure passwords kr key auth. Brute force is not a problem. What vulnerability are you talking about? Complete auth bypass? Then the username would be no problem either since you can just brute force usernames.

@False@lemmy.world
link
fedilink
English
11Y

Heartbleed was a thing that happened.

@randombullet@feddit.de
link
fedilink
English
71Y

Defense in depth.

Anyone who’s certified NET+ or higher knows this.

@ShortN0te@lemmy.ml
link
fedilink
English
-11Y

That video here: https://youtu.be/fKuqYQdqRIs?feature=shared

Does a great job actually explaining a lot of my points. And it is produced by an actual security auditor and researcher. Just because everyone is doing it does not make it a security benefit that matters.

@PipedLinkBot@feddit.rocks
bot account
link
fedilink
English
31Y

Here is an alternative Piped link(s):

https://piped.video/fKuqYQdqRIs?feature=shared

Piped is a privacy-respecting open-source alternative frontend to YouTube.

I’m open-source, check me out at GitHub.

they need to guess a username i assume

Why disallow root login?

It is very easy to throw a dictionary at your port 22. It happens every few minutes. And they all try it with the username=root unless they know something better.

Create a post

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.

Resources:

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

Questions? DM the mods!

  • 1 user online
  • 126 users / day
  • 421 users / week
  • 1.16K users / month
  • 3.85K users / 6 months
  • 1 subscriber
  • 3.68K Posts
  • 74.2K Comments
  • Modlog