Securing a Linux Computer at Home: 10 Weak Points and Their Fixes
Ten places where a home Linux PC, laptop or Raspberry Pi is commonly left open, from skipped updates to forwarded ports, each with its fix.
4 min readBy Daniel
Reviewed by the AmazingRDP technical team

Keep services that must face the internet off your home network: put them on a Linux VPS. See Linux VPS from $6.99
Linux at home has a good reputation for safety, and mostly earns it. Break-ins on home Linux machines do happen, though, and almost never through some exotic flaw. They happen through a handful of ordinary gaps: a Raspberry Pi with its password unchanged, a port forwarded and forgotten, a system not updated since it was set up. Here are the ten most common, with the fix for each. Whether you also need a virus scanner is a separate question, answered in does Linux need antivirus.
1. Updates that never happen
Most attacks use flaws for which a fix has existed for months.
sudo apt update && sudo apt upgrade
sudo apt install unattended-upgrades && sudo dpkg-reconfigure -plow unattended-upgrades
The second line installs security fixes automatically, which suits machines nobody looks at, such as a Pi in a cupboard. More in APT commands. Also check that the release itself is still supported: an interim Ubuntu version expires after nine months (an example).
2. Weak or default passwords
Devices and images that ship with a known user name and password are found by scanners within minutes of being reachable. Change every default, and use long passwords from a password manager.
passwd
3. SSH open with password login
If you reach the machine by SSH, use keys and switch passwords off: SSH keys, then SSH hardening. If you never use SSH, do not run it:
sudo systemctl disable --now ssh
4. No firewall
Most desktop distributions install a firewall and leave it off.
sudo ufw default deny incoming
sudo ufw enable
sudo ufw status
On a laptop that joins café and hotel networks this matters most. A graphical front end is described in GUFW; the rules in the Ubuntu firewall.
5. Services you did not know were listening
sudo ss -tulpn
The list shows every program that accepts connections. Anything listening on 0.0.0.0 is reachable from the network. Remove or stop what you do not need: old file-sharing services, a database from an experiment, a media server. See checking open ports.
6. Ports forwarded on the router
A port forward, set up once to reach something from outside, exposes that service to the whole internet for as long as it exists. Look through your router's forwarding list and its UPnP setting, which lets devices open ports by themselves; switch UPnP off unless you need it. Better ways to reach home from outside are a VPN on the router or on a small server: WireGuard.
7. Software from anywhere
- Commands pasted from a web page into a terminal, above all
curl … | sudo bash, run with full rights whatever the page's author wrote. - Third-party repositories and PPAs can replace any package on the system.
- Packages from public registries for Python and JavaScript are sometimes malicious look-alikes of popular names.
Prefer the distribution's own packages, then Flatpak or Snap from the official stores. Read a script before running it.
8. Everything done as root
Daily work belongs in an ordinary account, with sudo for the moments that need it: creating a sudo user. A browser running as root turns any browser flaw into a system takeover.
9. A laptop without disk encryption
A lost or stolen laptop hands over every file, saved password and SSH key, unless the disk is encrypted. The installer offers this with one tick box; afterwards, a data partition or container can still be encrypted: encrypting a disk on Ubuntu. Lock the screen when you walk away.
10. The other devices on the network
The Linux PC is often the best-kept device in the house. The router with firmware from years ago, the camera with its default password, and the network storage box exposed to the internet are easier ways in.
- Update the router's firmware and change its administrator password.
- Use WPA2 or WPA3 with a long Wi-Fi password; switch off WPS.
- Put smart-home gadgets and guests on a separate network if the router offers one.
And the one that undoes the rest: no backups
Hardware fails, files are deleted by mistake, and ransomware exists for Linux too. Keep a copy on a disk that is not permanently connected, and one somewhere else. Tools such as Timeshift (system snapshots), Déjà Dup and BorgBackup make it painless: backup methods.
A ten-minute check
| Check | Command or place | Good |
|---|---|---|
| Updates pending | apt list --upgradable | Few or none |
| Firewall | sudo ufw status | active |
| Listening services | sudo ss -tulpn | Only what you know |
| Recent logins | last -a | head | Only yours |
| Failed SSH logins | sudo journalctl -u ssh | grep -c Failed | Zero if SSH is not exposed |
| Users with a shell | grep -v nologin /etc/passwd | Only known accounts |
| Router port forwards | The router's web page | None you cannot explain |
A fuller audit with suggestions is one command away: sudo lynis audit system.
Hosting from home, or not
Many of these weak points come from running services at home that are meant to be reached from outside: a website, a game server, a file share. Each one is a door into the network your family's devices live on. Moving such services to a rented server keeps strangers' traffic away from your home network altogether, gives them a stable address, and frees your own connection. A small Linux VPS is enough for most of them; the usual first steps there are in SSH hardening.
Questions
Is Linux safe to use at home?
Yes, when it is kept updated, default passwords are changed, a firewall is on and no unneeded services face the internet.
How do I enable the firewall on Ubuntu?
sudo ufw enable, after sudo ufw default deny incoming.
How do I see which services are listening on my Linux PC?
sudo ss -tulpn lists every listening program and its port.
Is it safe to forward ports on my home router?
Each forwarded port exposes a service to the whole internet. Remove forwards you do not need and prefer a VPN for access from outside.