Noob here can you please explain what the 2nd line does? Thanks!
Selfhosted
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:
-
Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.
-
No spam posting.
-
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.
-
Don't duplicate the full text of your blog or github here. Just post the link for folks to click.
-
Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).
-
No trolling.
Resources:
- selfh.st Newsletter and index of selfhosted software and apps
- awesome-selfhosted software
- awesome-sysadmin resources
- Self-Hosted Podcast from Jupiter Broadcasting
Any issues on the community? Report it using the report flag.
Questions? DM the mods!
IP white lists and firewall exceptions will help, but exposing ports on your home router is almost always a bad idea, especially for something as trivial as a game server.
I would highly recommend Tailscale. It's free for up to 3 users, and if you have more friends than that, I would have them all sign up with free accounts and then share your laptop device with their tailnets.
It's very easy to setup and use, costs nothing, and will be far more secure than opening ports and trying to set up IP white lists, protocol limitations, etc.
Tailscale creates something called an "overlay network" it's basically a virtual LAN that exists on top of your real network and can be extended to other people and devices over the internet. It's fully encrypted, fast, and like I said, very easy to set up.
This community is like 90% tailscale shills.
?...It's a great tool that provides all the security of VPN access without having to struggle with the more technical aspects of spinning up your own VPN, and it's zero cost for personal use.
You could also use Netbird if you wanted, but I have been using Tailscale extensively and it's awesome.
Fine, use Netbird or whatever else floats your boat.
In the old days hamachi used to be all the rage to VLAN with your friends with pirated copies of games. Wonder how hamachi is doing nowadays.
Yeah if this is for a small number of users, I would recommend wireguard or tailgate.
Port forwarding is asking for trouble.
More effort than I would consider. I'd just allow all traffic incoming on that port. I'd only consider whitelist if someone was giving me grief. Even then that would be after blacklisting an IP wasn't solving my problem.
Port 22 is the default SSH port and it receives a TON of malicious traffic any time it’s open to the whole internet. 20 years ago I saw a newly installed server with a weak root password get infected by an IP address in China less than an hour after being connected to the open internet.
With all the bots out there these days it would probably take a lot less time if we ran the same experiment again.
Ha. That's my bad. I didn't even read the firewall rules listing 22/SSH. I agree on not opening 22 to the world. It just invites bots throwing passwords at it.
I just read Minecraft in the original post which from reading runs from 25565 which I wouldn't worry about. If OP needs 22 for admission I'd either whitelist it or use a VPN/Tailscale.
25565 also gets a decent amount of malicious traffic because of Minecraft though. I'd recommend switching the port to something different at the very least. When I hosted a server for the first time on 25565 my router pretty immediately gave me warnings about attempted network traffic coming from Europe/Asia when I (and everyone I gave the IP to) live in the US.
if I were you, I would do IP whitelisting at the firewall instead of or besides the Minecraft server
This might also become a hassle since basically all residential connections (likely of OPs friends) have dynamic IPs - if someone wants to join while OP is away, but their IP has changed since their last connection, now they have to wait on OP to update the firewall rules.
Apart from getting your MSA token stolen, there's not really much that can get around server login (yet). All online-mode logins pass through Microsoft (part of the reason why Xbox service outages seem to affect Minecraft so much).
If your friends all individually seem to stay within some certain IP ranges (ex, first handful digits always stay the same, 12.34.56.xx), then I'd say go ahead with whitelisting them fully (ex, 12.34.56.xx --> 12.34.56.0/24, CIDR notation). If they jump around unpredictability, I would stick with the username-based whitelisting and online-mode-only.
maybe a wireguard network is the way to go then, of course without being configured as the default destination for everything. there IPs are always fixed, but at that point you don't even need a firewall
as long you are only forwarding Minecraft's 25565 port from your router to your server machine, it should be fine. Just make sure to keep Online mode on, use the whitelist, and get your plugins from trusted sources. Otherwise I wouldn't worry too much.
I see others recommending VPN solutions like zerotier for your friends to connect to; I don't personally feel like this is necessary, and (in my experience), making your friends do more technical setup than just connecting to the server is often a big turn-off.
Bonus: If you ever take a peek at your server logs while it's running (and exposed to the Internet, if you avoid said VPN solutions), you might notice a lot of weird connections from IPs and usernames you don't recognize. These are server scanners and threat scanners that look for vulnerable servers to connect to and exploit. This is normal and you'll be fine as long as you keep that whitelist and stay up-to-date on developments in the server admin space.
It is all about risk management. What you are doing now is pretty solid. It might be easier to have them use a mesh VPN like netbird or tailscale