this post was submitted on 25 Jun 2023
10 points (100.0% liked)

Selfhosted

39224 readers
386 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.

Resources:

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

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

Any guides on how to host at home? I'm always afraid that opening ports in my home router means taking the heavy risk of being hacked. Does using something like CloudFlare help? I am a complete beginner.

Edit: Thanks for all the great response! They are very helpful.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] -1 points 1 year ago* (last edited 1 year ago) (8 children)

First you've got to determine where threats can come from, then which surfaces are vulnerable and eventually the reach. In short what I mean:

SSH port (default 22) is high on the threat encounter level. Lots of bots try to scan every host they can find for an open SSH port. The risk is high because this is a doorway to your network. There's honestly no good reason to have port 22 open to your home. Get tailscale vpn. There are alternatives, I use tailscale, it's great.

When youre hosting apps, they can also be vulnerable. Keep them updated and you'll mostly be fine. There are levels of security. Super super secure is creating seperate networks for these apps so they can't access others. Bit much imo. Use non-rooted docker, enough of a sandbox.

In the end you're a small fish in a big pond, not saying you should be a cowboy but with a few decent measures you should be OK.

Tl;dr

  • don't open port 22
  • use a VPN (tailscale)
  • update apps
  • non-rooted docker
[–] [email protected] 1 points 1 year ago (7 children)

What's wrong with exposing port 22? I have password authentication disabled, ssh keys only. Isn't that secure enough?

[–] [email protected] 0 points 1 year ago (1 children)

I do as well on a non-standard port, although that doesn't really provide any extra security. I found ssh only login acceptably secure personally, but it's definitely less secure than tailscale which can operate with 0 open ports. The risk would be from os/sshd vulnerabilities that can be exploited. As long as you keep the router up to date it should be safe enough.

[–] [email protected] 0 points 1 year ago* (last edited 1 year ago) (2 children)

Why would you expose SSH on a home production server?
Hosting several dockerized apps for friends since years. Only 80/443 proxy ports are open. Apps are secured with 2FA and monitored by fail2ban + kept up-to-date. Never had any issue.

[–] [email protected] 1 points 1 year ago (1 children)

Why not? Openssh has proven itself to be reasonable secure. Porbably more research went into its security then most apps you are hosting.

[–] [email protected] 0 points 1 year ago

I think it's not so much "insecure" as that it's that external SSH access is less secure than no access. And for home-managed systems exposed externally, I would recommend a smaller attack area.

[–] [email protected] 0 points 1 year ago (1 children)

It's for the chance that I need to administer my cluster when I am not on my LAN. I can set up a port forward to the externally accessible port and everything works as normal like I'm on my LAN. Non-default port, password auth disabled, ssh with root disabled (so you have to have my user and ssh key) and limited ssh connection attempts before ban. I can toggle it on or off with a check box on my router. Yes, I understand there are other ways that are even more secure, yes I understand the risks, but for my circumstances this was a good balance of convenience and security. I've also never had an issue :).

[–] [email protected] 1 points 1 year ago (1 children)

Add VPN and you made the best out of it :)

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago)

If I am trying to fix problems with my cluster or the baremetal hosts they are running on, I can't rely on the VPN access running on those nodes, which means I need dedicated reliable hardware acting as a bastion. Right now all I have for that is my router. Home routers have awkward limitations for installing and configuring software even if you are running better custom firmware like FreshTomato or OpenWRT, making them an edge case for "just" set up a VPN. Yes I played around with making it work. Yes, I could make it work if I sunk enough effort in to it, but again, I found it acceptably secure to simply enable remote ssh access.

I do suggest talescale all the time for most people though. It's cool tech, their blog is fantastic. I'm looking forward to having a proper network switch one day and I'll revisit the issue.

load more comments (5 replies)
load more comments (5 replies)