Debian GNU/Linux · Services

Remove the X Window System server from servers

When it fails: An X Window System server is installed on a server. A graphical server stack adds a large amount of privileged, rarely needed code.

CB-DEB-SVC-024lowactiveautomatedautomated fixprofile server-hardened

As released in v0.1.1 beta · pre-release. Current state.

Description

xserver-common holds the files shared by every X.Org server (Xorg, Xvfb, Xephyr...). When it is absent, no X server is installed.

The control is only in the hardened server profile; desktops need an X server or Xwayland.

Rationale

An X server is complex software, historically run with root privileges, with a long record of local privilege escalation flaws. A server administered over SSH does not need it.

Impact

Removes xserver-common and every package that depends on it: X servers, and the graphical desktop if one is installed. X client applications forwarded over SSH (ssh -X) still work, since they use the X server of the administrator's workstation.

Audit

Run dpkg-query -W -f='${Status}\n' xserver-common. It must not print install ok installed.

Automated: every check must pass. Scanners report each check by its id.

xserver-common

X.Org server common files.

name: xserver-common
state: absent

Remediation

Run apt purge xserver-common after checking the list of packages apt will remove.

Restartnone
Disruptionlow

Rollback

Reinstall the needed X server, for example apt install xserver-xorg-core.

xserver-common

Generated from check xserver-common: the engine writes the fix for every output, it sets the expected value and the check runs again after.

Each release turns these fixes into remediate.sh and an Ansible role per profile: dry run by default, a fix runs only when its check fails.

References

Mappings

FrameworkIDRelationNote
ANSSI-BP-028 - Recommandations de configuration d'un système GNU/Linux2.0R58partialR58 asks to install only the packages that are strictly needed; this control covers the X server.
NIST SP 800-53 Rev. 55.1.1CM-7partial

How this control relates to the other framework's: equivalent, stricter, looser, partial or related.

Threats mitigated

People and lifecycle

Authors
Verified2026-10-18 by Sn0wAlice on 12, Proxmox VM, Debian 12 genericcloud image, kernel 6.1.0-54-cloud-amd64. Fresh image passes; with xserver-common installed the check fails, fix purges it, audit passes after reboot; SSH reachable.
Verified2026-10-18 by Sn0wAlice on 13, Proxmox VM, Debian 13 genericcloud image, kernel 6.12.113+deb13-cloud-amd64. Fresh image passes; with xserver-common installed the check fails, fix purges it, audit passes after reboot; SSH reachable.
Introduced inv0.1.0
Created, updated2026-10-18, 2026-10-18
Translationsfr