85

I just setup a minecraft server on an old laptop, but to make it acessible i needed to open up a port. Currently, these are the ufw rules i have. when my friends want to connect, i will have them find their public ip and ill whilelist only them. is this secure enough? thanks

`Status: active

To Action From


22/tcp ALLOW Anywhere Anywhere ALLOW my.pcs.local.ip`

also, minecraft is installed under a separate user, without root privlege

you are viewing a single comment's thread
view the rest of the comments
[-] just_another_person@lemmy.world 3 points 2 years ago* (last edited 2 years ago)

You cant. You can only do your best to make it as secure as possible, but given enough time, someone can break it.

Basic tips:

  • don't run any services on their defaults ports
  • don't allow password auth for any exposed service. Ever.
  • run intrusion detection (fail2ban for simple ssh / Crowdsec for something a little beefier)

For ssh specifically, lock down your sshd config, make sure only key-based auth is enabled, and maybe as an extra step, create a dedicated user, and jail it by only allowing it access for the commands you need to interact with.

[-] novalex@lemmy.world 1 points 2 years ago
[-] just_another_person@lemmy.world 1 points 2 years ago* (last edited 2 years ago)

Not sure I can expand on it a ton more in a way that will make sense if it already doesn't sound familiar.

Basically, there are various methods to authenticate yourself to most services. Password is usually the weakest and most succeptible to brute-force and social engineering. There's certificates, key pairs, RBAC...etc. You can even setup TOTP/MFA really easily for anything that supports it these days. Just don't leave a service hanging out on the Internet to get brute-forced by password though.

If you're unfamiliar with this, start with SSH and key pairs. It's probably the simplest intro and you can be up and running to try it out in seconds.

[-] novalex@lemmy.world 1 points 2 years ago

Got it, I’m aware password auth can be brute forced, sadly many services don’t support more advanced auth methods so I’ve got a couple homelab apps that can only do password auth. I’m using very strong passwords and 2FA where available, and have been looking into an SSO solution like Authentik, but again not all services are supported.

this post was submitted on 08 Sep 2024
85 points (96.7% liked)

Selfhosted

62371 readers
1313 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:

Detailed Rules Post

  1. Be civil.

  2. No spam.

  3. Posts are to be related to self-hosting.

  4. Don't duplicate the full text of your blog or readme if you're providing a link.

  5. Submission headline should match the article title.

  6. No trolling.

  7. Promotion posts require active participation, with an account that is at least 30 days old. F/LOSS without a paywall has exceptions, with requirements. See the rules link for details. Tags [CBH] or [AIP] are required, see the links in Rule 8 for details.

  8. AI-related discussions and AI-involved promotional posts have additional requirements for tagging, as noted in Rule 7 and the AI & Promotional Post Expanded Rules post, and find example disclosures here.

Resources:

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

Questions? DM the mods!

founded 3 years ago
MODERATORS