Skip to content

Security and Updates

Outcome: you know which protections a YunoHost server runs before you change anything — the firewall, the login guard, the SSH rules and the password checks — and how the machine keeps itself up to date.

A server on the public internet is probed constantly, mostly by robots. YunoHost's answer is not a security product; it is a set of sensible defaults, shipped switched on and managed by the same tools as everything else. This chapter inventories them from the source and the documentation.

The firewall

YunoHost manages the machine's firewall (built on Linux's nftables) itself. The web ports, mail ports and SSH are open because the services need them; other ports are closed unless an app or the administrator opens them. The webadmin has a Firewall section, and the command line mirrors it: yunohost firewall list to see the rules, allow and disallow to change them. When you install an app that needs an extra port, its package declares it — you should rarely open ports by hand, and every manual opening deserves a note about why, because the diagnosis tool's port checker (chapter 10) will keep the outside view honest. UPnP support exists in the firewall commands for home routers that cooperate, though deliberate router forwarding (chapter 3) is the arrangement you can reason about.

Fail2ban: the login guard

Fail2ban ships installed and active. It watches the authentication logs — SSH, mail, the webadmin — and when one address fails to log in too many times, it has the firewall ban that address for a while. It is not subtle and it is not complete protection, but it removes the background radiation of password-guessing robots, which is most of what a small server ever faces. Like the other services it appears in the service list (yunohost service status fail2ban) and in the diagnosis's service checks.

SSH, deliberately narrowed

The SSH rules are the ones chapter 4's installer warned you about:

  • After the postinstall, root cannot log in by SSH from the internet — root login survives only from the local network or the machine's own console, as a break-glass path if the user directory itself is broken. You log in as your YunoHost user and use sudo from there.
  • By default, only members of the admins group may use SSH and SFTP at all. Ordinary users have no shell. The permissions system (chapter 6) can grant SSH or SFTP to a specific user or group when there is a reason.
  • SSH keys are managed per user from the command line (yunohost user ssh add-key — the webadmin does not offer it yet, per the documentation).

Passwords with a floor under them

The portal is the front door, so its passwords get two reinforcements. User passwords have a minimum length (8 characters, per the documentation, with the standard advice that a passphrase is better), and the core ships a list of the 100,000 most commonly used passwords — visible in the source as 100000-most-used-passwords-length8plus.txt.gz — against which new passwords are checked. A server whose every user picked a password from that list would be a Fail2ban customer forever; the check prevents the worst of it at the source.

The portal's boundary

Worth stating plainly, because chapter 6 made it easy to miss: granting the visitors permission is publishing. SSOwat enforces permissions, but it cannot judge whether an app should be public, and some apps are safe to expose only because their own login screen is the real lock. The protected permissions — the ones visitors cannot be added to — are the system's guardrail; your judgement about the rest is the security model. Keep the set of admins small for the same reason: an admin account is SSH, mail for the whole domain, and the webadmin in one password.

Updates: one road, walked two ways

Keeping current is the highest-value security habit, and YunoHost makes it a single road:

  • The webadmin's update view, or yunohost tools update followed by yunohost tools upgrade, upgrades both the system (Debian packages) and YunoHost and its apps — apps can also be upgraded individually with yunohost app upgrade, each preceded by its safety backup (chapter 11).
  • Between major versions, yunohost tools migrations lists and runs the guided migrations — the deliberate, announced jumps (a new Debian base is the big one), which are treated as events to schedule, not surprises to discover.

A routine that works: read the diagnosis email (it notices version inconsistencies), apply updates on a weekly rhythm, and never let a migration and a hardware change share a weekend.

What is not provided

No antivirus, no intrusion detection beyond Fail2ban and the login-attempt counting in the diagnosis, no web application firewall in front of your apps, and no protection against an administrator account with a weak password being phished — the human layer remains yours. The system's posture is "hardened appliance", not "fortress", and chapter 15 prices that honestly.