| Post Reply | RetroFed Forums Forum Index » Selfhosted |
| Author | Message | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
JupiterSnarl lemmy.world ![]() KingDingbat@lemmy.world Joined: 2025-03-10 |
So I'm relatively new to server hosting. (But experienced with remote web hosting from providers.) After about a year of fighting to run Nextcloud on a hosting company and finally losing everything from the cPanel vulnerability a few months ago, I broke down and launched my own home server. I'm looking for advice to maximize security. CachyOS Linux with ClamAV I have regular redundant backups both onsite and offsite with Duplicati. My passwords for OS and all admin dashboards are extremely long, unique, random strings managed by Bitwarden. I know just enough about this stuff to get into trouble. What else should I setup? I have little to no monitoring going on and don't know much about that direction. |
||||||||||||||||||||
| 107 Original | |||||||||||||||||||||
|
stoy lemmy.zip stoy@lemmy.zip Joined: 2023-10-17 |
Have you read the TOS of your ISP, are you allowed to run a home server exposed to the internet? It might be a good idea to at least read what the TOS says just so you are aware of potential consequences. |
||||||||||||||||||||
| 5 | |||||||||||||||||||||
|
hendrik palaver.p3x.de hendrik@palaver.p3x.de Joined: 2021-08-21 |
Timely updates do a lot of the heavy-lifting. And I hope you picked a better admin dashboard this time or that's properly locked behind some tunnel. I myself try not to run admin dashboards. SSH with keys is more convenient and secure anyway. |
||||||||||||||||||||
| 25 | |||||||||||||||||||||
|
zlatko programming.dev zlatko@programming.dev Joined: 2023-06-30 |
Have you read the TOS of your ISP, are you allowed to run a home server exposed to the internet? It might be a good idea to at least read what the TOS says just so you are aware of potential consequences.
If the OP has it only reachable via a VPN, that might be good enough, it's not directly exposed. But otherwise yes. Another, more important problem with publicly available home server: they lost their data when their setup was maintained by a professional hoster. According to the OPs words, they themselves "know just enough to be dangerous". Exposing any of this to the public internet wouldn't be a good idea however you put it. |
||||||||||||||||||||
| 4 | |||||||||||||||||||||
|
hendrik palaver.p3x.de hendrik@palaver.p3x.de Joined: 2021-08-21 |
Have you read the TOS of your ISP, are you allowed to run a home server exposed to the internet? It might be a good idea to at least read what the TOS says just so you are aware of potential consequences.
And if you do, make sure to read them thoroughly. Most of these rules apply to for-profit hosting only. Or they're vague and they can't enforce them. And most contracts don't have rules anyway. They're mostly concerned with you not attracting DCMA complaints or a virus hosting some spam email server. |
||||||||||||||||||||
| 7 | |||||||||||||||||||||
|
zlatko programming.dev zlatko@programming.dev Joined: 2023-06-30 |
A few tips off the top of my head, in no particular order:
|
||||||||||||||||||||
| 20 | |||||||||||||||||||||
|
NaibofTabr infosec.pub NaibofTabr@infosec.pub Joined: 2023-06-18 |
The most important answers to this all live outside your server. What is your home network like? Do you control the gateway? Do you have a dedicated firewall? Do you have devices segregated into VLANs so they can't observe each other (especially IoT devices)? Do you have SNMP disabled?
If you want security, you block all inbound and outbound traffic by default at your network firewall (not the server OS firewall), and then you open only the ports that you actually need, one by one. You set all the closed external ports to do not respond ("stealth" mode), so that anybody trying to reach your network from outside just gets nothing back except on the ports you specifically need to use. You segregate your internal network into logical areas, and you put things that need to talk to each other on their own VLAN, which may or may not have access to the upstream WLAN trunk depending on what they're doing. You don't allow crosstalk between VLANs except in very specific cases. You set static IPs and document them, so that you never have to ping or traceroute internally to find something, so you don't need SNMP. Anybody trying to use SNMP is conducting surveillance on your network and should stick out from other traffic (some "smart"/IoT devices do this automatically - they are bad and should be treated as malicious and should not be allowed to phone home). And then you monitor your traffic at the firewall, and you deal with anything unexpected as it comes up (like once a week review the logs until you have a sense of what normal looks like on different days at various times, then maybe set a few automatic alerts for things that exceed normal-ish boundaries, then go to reviewing like once a month or so - you don't need to be checking your logs hourly unless you have some reason to be actively paranoid). If you handle everything correctly at the router/firewall level, you're way way beyond the security of most residential and small business networks. You're not, you know, impenetrable, but you're at the point where somebody with experience and resources will have to be trying to break into your network specifically on purpose. If you're that kind of target then nothing short of an actual SOC is going to help you, and running self-managed servers on your home network is a bad idea. |
||||||||||||||||||||
| 7 | |||||||||||||||||||||
|
foggy lemmy.world foggy@lemmy.world Joined: 2023-07-02 |
Use authelia for 2fa Disable root ssh Disable password authentication for ssh. Keys only. Set up Fail2ban That's about all that's left; 2fa and brute force protection. Good job. |
||||||||||||||||||||
| 28 | |||||||||||||||||||||
|
StateMachine lemmy.zip StateMachine@lemmy.zip Joined: 2026-10-06 |
Use authelia for 2fa Disable root ssh Disable password authentication for ssh. Keys only. Set up Fail2ban That's about all that's left; 2fa and brute force protection. Good job.
And move SSH to a non-default port. Without that, my public-facing servers get thousands of SSH attacks a day, and it basically goes to zero after moving it to a random-looking high port. Also, totally agree with using public key login and disable password login. |
||||||||||||||||||||
| 13 | |||||||||||||||||||||
|
RedGreenBlue lemmy.zip RedGreenBlue@lemmy.zip Joined: 2025-06-05 |
Get a FIDO2 security key for SSH keys. |
||||||||||||||||||||
| 2 | |||||||||||||||||||||
|
miaowoo_cafe lemmy.cafe miaowoo_cafe@lemmy.cafe Joined: 2026-10-17 Banned |
[removed by moderator]
|
||||||||||||||||||||
| -12 | |||||||||||||||||||||
|
LeFrog discuss.tchncs.de ![]() LeFrog@discuss.tchncs.de Joined: 2023-06-14 |
[removed by moderator]
If they wanted AI slop they would have asked some LLM themselves. Please stop dumping your slop. |
||||||||||||||||||||
| 12 | |||||||||||||||||||||
|
Ooops feddit.org ![]() Ooops@feddit.org Joined: 2024-07-06 |
And move SSH to a non-default port. Without that, my public-facing servers get thousands of SSH attacks a day, and it basically goes to zero after moving it to a random-looking high port. Also, totally agree with using public key login and disable password login.
That's generally good advice but not actually security related. Removing all the stress on your ressources by using a non-standard port is good for your ressources, But those automated scanners looking for unsecured devices and trying out password like admin/admin are not actually a risk. It's just a case of security by obscurity and never actually serves its purpose. |
||||||||||||||||||||
| 16 | |||||||||||||||||||||
|
Nomecks lemmy.ca Nomecks@lemmy.ca Joined: 2023-12-27 |
Grab OpenBao (Opensource Hashicorp Vault) and begin using key management. You can do things like app roles, TOTP, single use wrapped tokens, key rotation and more to make sure that long lived access doesn't exist. |
||||||||||||||||||||
| 1 | |||||||||||||||||||||
|
Possibly linux lemmy.zip ![]() possiblylinux127@lemmy.zip Joined: 2023-06-26 |
Don't put it on the internet Instead, use a VPN solution. I'm also not sure why you setup ClamAV. It doesn't really do much and is probably a complete waste of time. If anything you should setup and properly configure SElinux but it isn't trivial to do and is overkill. Simply keeping your stuff of the internet will do far more for your security than anything else. |
||||||||||||||||||||
| -4 | |||||||||||||||||||||
|
Possibly linux lemmy.zip ![]() possiblylinux127@lemmy.zip Joined: 2023-06-26 |
And move SSH to a non-default port. Without that, my public-facing servers get thousands of SSH attacks a day, and it basically goes to zero after moving it to a random-looking high port. Also, totally agree with using public key login and disable password login.
OpenSSH rate limits authentication attempts so it isn't a big deal. My public VPS gets pounded but it doesn't matter as it doesn't really use any system resources. |
||||||||||||||||||||
| 0 | |||||||||||||||||||||
|
Possibly linux lemmy.zip ![]() possiblylinux127@lemmy.zip Joined: 2023-06-26 |
I'm looking for advice to maximize security. The most important answers to this all live outside your server. What is your home network like? Do you control the gateway? Do you have a dedicated firewall? Do you have devices segregated into VLANs so they can't observe each other (especially IoT devices)? Do you have SNMP disabled? Containers are not a security barrier. They cannot be, they never...
I'm not sure you know what SNMP is Also Iot devices aren't really much of a threat. It doesn't hurt much to put them on a separate vlan but the security issues are mostly unrelated to a local home network. Also don't put things on the internet. That is generally a really bad idea and will bite you in the butt eventually. |
||||||||||||||||||||
| 3 | |||||||||||||||||||||
|
gastroglizzy piefed.social gastroglizzy@piefed.social Joined: 2026-08-26 |
That's generally good advice but not actually security related. Removing all the stress on your ressources by using a non-standard port is good for your ressources, But those automated scanners looking for unsecured devices and trying out password like admin/admin are not actually a risk. It's just a case of security by obscurity and never actually serves its purpose.
Very true. There are only ~65K ports. If someone decides they want to, trying all of them to see which one gives a valid response is trivial. |
||||||||||||||||||||
| 6 | |||||||||||||||||||||
|
gastroglizzy piefed.social gastroglizzy@piefed.social Joined: 2026-08-26 |
I'm looking for advice to maximize security. The most important answers to this all live outside your server. What is your home network like? Do you control the gateway? Do you have a dedicated firewall? Do you have devices segregated into VLANs so they can't observe each other (especially IoT devices)? Do you have SNMP disabled? Containers are not a security barrier. They cannot be, they never...
Not entirely true. If you're hosting multiple game servers on one machine, for example, it's best to run each instance in a container. Game servers, by their nature, are required to have public IPs and ports, and some of them run on old engines that are vulnerable to various DoS methods. If your server is attacked, it might crash the container(s), but it can't bring the whole server down. |
||||||||||||||||||||
| 1 | |||||||||||||||||||||
|
Reannlegge lemmy.ca Reannlegge@lemmy.ca Joined: 2025-02-13 |
If you are paying for Bitwarden, or using their free tier, stop and and start hosting vaultwarden. You can still use the Bitwarden app, with vaultwarden but with all the premium features. Get a firewall you can either install OpenWRT or opnSense on, when making my decision I went with OpenWRT because opnSense has a webpage that tries to upsell you. vLAN the heck out of your place, and set up a VPN to access your services like vaultwarden out side of your home. On a vLAN that cannot access your WAN or anything else put your IoT things, on a vLAN that cannot access anything else setup crowdsec. On the topic of crowdsec it should be your only device that port 22 is ssh! For your IoT things set up home assistant, which should be on a different vLAN that can reach out to the WAN and into the IoT vLAN to control stuff. I wish I could say I have completly degoogled and deappled, but I am waiting for a year for my iPhone to stop getting updates and whenever for my iPad to stop getting updates. I should probably replace my homepod minis sooner rather than later with the Naebu things for HA. The only thing I still have a Google account for is youtube but once I get a hand me down Mac mini I will install Debian and get a youtube replacement with sponsor block. One of the things that finally got me off of cPanel was the host I was using decided to rape me over the coals without letting me have a wildcard email address so I got a business plan that I could have unlimited email addresses so if one got spammy I could just turn it off and if I still used the service I just changed the email, or if I wanted to extend a free trial I could just spin up a new address. So I recently moved to a new host that offers wild card addresses. Get a whole LAN adblocker, let it be pihole or adguard home, there was recently that spyware ad pixel so expect more of those in the future. Me personally use pihole and have it very finally tuned to block a lot. I tried adguard once but liked pihole better, this was years ago even before I had pihole finaly tuned so don’t ask me why I liked pihole more. |
||||||||||||||||||||
| 4 | |||||||||||||||||||||
|
foggy lemmy.world foggy@lemmy.world Joined: 2023-07-02 |
Very true. There are only ~65K ports. If someone decides they want to, trying all of them to see which one gives a valid response is trivial.
Literally a single nmap command will tell me where you "hid" your ssh port. Like the poster you're responding to said, it is good advice but not for security. It takes you off the hacker spam list, essentially. Rereading this it sounds like I am disagreeing with you sorry. Just trying to reiterate your point. |
||||||||||||||||||||
| 6 | |||||||||||||||||||||
|
moldy_rice piefed.keyboardvagabond.com ![]() moldy_rice@piefed.keyboardvagabond.com Joined: 2026-08-07 |
Wazuh and TOTP |
||||||||||||||||||||
| 2 | |||||||||||||||||||||
|
moldy_rice piefed.keyboardvagabond.com ![]() moldy_rice@piefed.keyboardvagabond.com Joined: 2026-08-07 |
Use authelia for 2fa Disable root ssh Disable password authentication for ssh. Keys only. Set up Fail2ban That's about all that's left; 2fa and brute force protection. Good job.
Sub fail2ban for wazuh. It does the same but so much more, and does everything with 0 config after fresh install. |
||||||||||||||||||||
| 3 | |||||||||||||||||||||
|
NaibofTabr infosec.pub NaibofTabr@infosec.pub Joined: 2023-06-18 |
I'm not sure you know what SNMP is Also Iot devices aren't really much of a threat. It doesn't hurt much to put them on a separate vlan but the security issues are mostly unrelated to a local home network. Also don't put things on the internet. That is generally a really bad idea and will bite you in the butt eventually.
Oops, I was definitely confusing that with ICMP. Good point. https://oneuptime.com/blog/post/2026-03-20-block-icmp-firewall-risks/view
I consider it a threat if a device maps my local network, identifies the other devices I have connected, and/or monitors my network traffic and then sends a report on that back to its control server.
Ain't that the truth. We really should just not. |
||||||||||||||||||||
| 1 | |||||||||||||||||||||
|
Trucule lemmy.world Trucule@lemmy.world Joined: 2023-07-01 |
For monitoring, I'd start with alerts on changes you didn't make. Save a baseline of listening ports with Keep the baseline files outside your Docker volumes. Also send a notification on every successful SSH login with a short script in Uptime Kuma covers whether Nextcloud, Immich, and DocuSeal are still reachable through the tunnel, and it can send its alerts to ntfy as well. Drafted with AI. |
||||||||||||||||||||
| 4 | |||||||||||||||||||||
|
Decronym Bot Decronym@lemmy.decronym.xyz Joined: 2026-01-05 |
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
[Thread #139 for this comm, first seen 18th Oct 2026, 03:40] |
||||||||||||||||||||
| 2 | |||||||||||||||||||||
|
miaowoo_lw lemmy.world miaowoo_lw@lemmy.world Joined: 2026-10-17 Banned |
[removed by moderator]
|
||||||||||||||||||||
| -3 | |||||||||||||||||||||
|
JupiterSnarl lemmy.world ![]() KingDingbat@lemmy.world Joined: 2025-03-10 |
Thank you all for your advice and tips. I am very overwhelmed by the sheer amount of information that's been given and I'm going to spend some time digesting and reading up on these things. Lots of terminology is over my head at this point and I have a lot of learning to do. |
||||||||||||||||||||
| 3 | |||||||||||||||||||||
|
Treczoks lemmy.world Treczoks@lemmy.world Joined: 2023-07-09 |
What I did was setting up two routers. The outer one is a big filter, and the only packets coming in went through it. If someone would have managed to take over this outer router, the next step would have been to probe the inner router. For this, they would send packets originating at the outer router to anything on the inside net. This would trigger an alert on the inner router that switches a relay, cutting the power on the outer router. |
||||||||||||||||||||
| 4 | |||||||||||||||||||||
|
Appoxo lemmy.dbzer0.com ![]() Appoxo@lemmy.dbzer0.com Joined: 2023-07-01 |
What I did was setting up two routers. The outer one is a big filter, and the only packets coming in went through it. If someone would have managed to take over this outer router, the next step would have been to probe the inner router. For this, they would send packets originating at the outer router to anything on the inside net. This would trigger an alert on the inner router that switches a...
Why should they take over the outer router if they can just take over the destination they were routed to? |
||||||||||||||||||||
| 7 | |||||||||||||||||||||
|
Treczoks lemmy.world Treczoks@lemmy.world Joined: 2023-07-09 |
Why should they take over the outer router if they can just take over the destination they were routed to?
That is a separate issue. Hardening a single service that happens to offer a login is easier than hardening a whole bunch of services that were never intended to face the net. |
||||||||||||||||||||
| 1 | |||||||||||||||||||||
|
Appoxo lemmy.dbzer0.com ![]() Appoxo@lemmy.dbzer0.com Joined: 2023-07-01 |
That is a separate issue. Hardening a single service that happens to offer a login is easier than hardening a whole bunch of services that were never intended to face the net.
No I mean why would the attacker even attempt to attack your outside if they can just figure out what sits behind it, follow it through the NAT and then exploit it from there. |
||||||||||||||||||||
| 4 | |||||||||||||||||||||
|
NormDeplume lemmy.world NormDeplume@lemmy.world Joined: 2023-06-15 |
For monitoring, I'd start with alerts on changes you didn't make. Save a baseline of listening ports with ss -tlnp and of running containers with docker ps --format '{{.Names}} {{.Image}}', then have a daily cron job compare both against the baseline and push any difference to your phone with ntfy. Keep the baseline files outside your Docker volumes. Also send a notification on every successful...
This is an elegant and brilliant idea and I love it. Finding a way to formalize a baseline and then get notified for deviations from that baseline is a fundamental requirement for having things running smoothly. I've been working on a way to automate daily log parsing to get to the same state but including performance metrics and network traffic would definitely round out the signal. |
||||||||||||||||||||
| 1 | |||||||||||||||||||||
|
AustralianSimon lemmy.world ![]() AustralianSimon@lemmy.world Joined: 2023-06-08 |
My passwords for OS and all admin dashboards are extremely long, unique, random strings managed by Bitwarden. If you are paying for Bitwarden, or using their free tier, stop and and start hosting vaultwarden. You can still use the Bitwarden app, with vaultwarden but with all the premium features. Get a firewall you can either install OpenWRT or opnSense on, when making my decision I went with O...
Its one of the few services I really like paying for tbh. |
||||||||||||||||||||
| 4 | |||||||||||||||||||||
|
Treczoks lemmy.world Treczoks@lemmy.world Joined: 2023-07-09 |
No I mean why would the attacker even attempt to attack your outside if they can just figure out what sits behind it, follow it through the NAT and then exploit it from there.
I know that risk, but that has been mitigated by other means. There is no open port exposed to the net waiting to be hacked. It only opens on demand for a single connection. |
||||||||||||||||||||
| 1 | |||||||||||||||||||||
|
Reannlegge lemmy.ca Reannlegge@lemmy.ca Joined: 2025-02-13 |
If you are paying for Bitwarden, or using their free tier, stop and and start hosting vaultwarden. You can still use the Bitwarden app, with vaultwarden but with all the premium features. Its one of the few services I really like paying for tbh.
But why? If it is backup I personally have a VPS that backs up stuff and runs a few services. In a few weeks I am hoping to have a second off site backup as well. |
||||||||||||||||||||
| 1 | |||||||||||||||||||||
|
Appoxo lemmy.dbzer0.com ![]() Appoxo@lemmy.dbzer0.com Joined: 2023-07-01 |
I know that risk, but that has been mitigated by other means. There is no open port exposed to the net waiting to be hacked. It only opens on demand for a single connection.
May I ask with what you initiate the connection? |
||||||||||||||||||||
| 1 | |||||||||||||||||||||
|
Thaurin lemmy.world Thaurin@lemmy.world Joined: 2023-06-21 |
Sub fail2ban for wazuh. It does the same but so much more, and does everything with 0 config after fresh install.
Oh hey, thanks for that. I have eyed Sandfly before for filesystem drift detection among other things, but I don't think they have a free tier (anymore?). I also ran into Lynis, which performs health and compliance scans of your systems. Lots of good information and general hardening advice from that. |
||||||||||||||||||||
| 3 | |||||||||||||||||||||
|
Thaurin lemmy.world Thaurin@lemmy.world Joined: 2023-06-21 |
And move SSH to a non-default port. Without that, my public-facing servers get thousands of SSH attacks a day, and it basically goes to zero after moving it to a random-looking high port. Also, totally agree with using public key login and disable password login.
Why do you expose port 22 to the entire internet? Limit it to your own IP addresses and/or only allow access through your Wireguard/VPN ranges. Then changing the default port becomes meaningless. |
||||||||||||||||||||
| 3 | |||||||||||||||||||||
|
Treczoks lemmy.world Treczoks@lemmy.world Joined: 2023-07-09 |
May I ask with what you initiate the connection? Are you using some kind of STUN server/service?
Multiport Knock patterns. |
||||||||||||||||||||
| 1 | |||||||||||||||||||||
|
Trucule lemmy.world Trucule@lemmy.world Joined: 2023-07-01 |
This is an elegant and brilliant idea and I love it. Finding a way to formalize a baseline and then get notified for deviations from that baseline is a fundamental requirement for having things running smoothly. I've been working on a way to automate daily log parsing to get to the same state but including performance metrics and network traffic would definitely round out the signal.
I'd use the same baseline approach for logs and compare counts instead of reading lines. Count yesterday's warnings per unit with Drafted with AI. |
||||||||||||||||||||
| 2 | |||||||||||||||||||||
|
AustralianSimon lemmy.world ![]() AustralianSimon@lemmy.world Joined: 2023-06-08 |
But why? If it is backup I personally have a VPS that backs up stuff and runs a few services. In a few weeks I am hoping to have a second off site backup as well.
Its cheap, its secure and they have a better backup setup than me. |
||||||||||||||||||||
| 1 | |||||||||||||||||||||
|
Reannlegge lemmy.ca Reannlegge@lemmy.ca Joined: 2025-02-13 |
Its cheap, its secure and they have a better backup setup than me.
If it is for backup I will give you that. |
||||||||||||||||||||
| 1 | |||||||||||||||||||||
|
AustralianSimon lemmy.world ![]() AustralianSimon@lemmy.world Joined: 2023-06-08 |
If it is for backup I will give you that.
Plus it funds their open source version, features etc. |
||||||||||||||||||||
| 1 | |||||||||||||||||||||
| Post Reply | Page 1 |