Homelab Hardening Basics: Glances on Localhost and Locked-Down Samba
Two small habits that shrink a homelab's attack surface: keep monitoring APIs on localhost and tighten Samba shares.
AI-compiled from the author鈥檚 homelab notes. Verify against your own versions.
Glances monitoring API
- Install with
apt-get install glanceson the host. Debian鈥檚 package is Glances 4. - The web server is
glances -w. It listens on port61208. In Glances 4 that bind is every interface (0.0.0.0), with no password. It does not default to localhost. - Keep it local:
glances -w --bind 127.0.0.1. Client/server mode (-s) is a different port,61209. - Debian鈥檚 current Glances 4.3.1 package includes the Web UI files. Older packages, and some other distributions, omit them: the page is blank and only the API answers. Glances 5 (still a beta) moves the API to
/api/5and does bind to127.0.0.1by default. - Expose it to the LAN only through a tunnel or an authenticated proxy, never raw.
- Useful v4 endpoints:
/api/4/status,/api/4/cpu,/api/4/mem. - Troubleshoot with
systemctl status glancesandjournalctl -u glances -n 40.
Samba shares on Home Assistant OS
- The Samba share app can expose
local_apps,app_configs,backup,config,media,share, andssl. Older namesaddonsandaddon_configsstill point at the same folders. Enable only what you use. - The password is stored in the app options, so use a unique password that you have not reused anywhere else. Keep it in a password manager. Proton Pass (affiliate link) is one end-to-end encrypted option.
- NetBIOS and local master browsing are on by default. Turn both off on a modern network if you do not need legacy clients. Local master applies only while NetBIOS is on.
- Change those options under Settings > Apps > Samba share. A browser works. They are not limited to the phone app.
Takeaway
Default to localhost, expose through authentication, and trim every share you do not need.
Spot something wrong or outdated? Leave a comment below. Every comment is reviewed to keep these posts accurate.
By commenting, you agree to our Terms of use and confirm this is your own work. Short quotes are fine with a credit and link. Copied, unsafe, or abusive comments are removed. See something copied? Say so here.