AccountsService is a D-Bus service utilized heavily by the GNOME desktop environment (and other graphical interfaces like KDE) to query and manipulate user account information. It handles tasks such as storing user profile pictures, managing keyboard layouts, and tracking login frequencies for the graphical display manager (like GDM3). However, in a pure Ubuntu Server environment that lacks a GUI, AccountsService is entirely vestigial. It runs silently in the background, polling system files and consuming a small amount of memory, despite the fact that standard command-line tools (like usermod and /etc/passwd) handle all necessary user management tasks on a headless machine.
This guide explains how to completely disable and mask the AccountsService daemon on Ubuntu Server to eliminate unnecessary background processes.
Stop and Mask AccountsService via Systemctl
Because AccountsService is tightly integrated into the systemd dependency tree (and is often a soft dependency for graphical packages), simply attempting to uninstall it via APT can sometimes trigger the removal of other tangentially related packages. The safest and most effective method to neutralize it on a server is to mask the service.
- Log into your Ubuntu Server via SSH or the local terminal.
- First, check the current status of the daemon to verify it is running:
sudo systemctl status accounts-daemon.service - Stop the running process immediately:
sudo systemctl stop accounts-daemon.service - Next, disable the service so it does not start on boot:
sudo systemctl disable accounts-daemon.service - Finally, mask the service. Masking creates a symlink pointing the service file to
/dev/null. This guarantees that absolutely no other process, script, or D-Bus call can accidentally wake or start the daemon:sudo systemctl mask accounts-daemon.service
Verify the Deactivation
To ensure that the D-Bus system is no longer attempting to communicate with the daemon, you can verify its masked status.
- Run the status command again:
sudo systemctl status accounts-daemon.service - The output should clearly state
Loaded: masked (Reason: Unit accounts-daemon.service is masked.)and the active state should beinactive (dead).
Your headless Ubuntu Server is now free from the graphical user-management overhead of AccountsService. All future user modifications must be performed using standard GNU core utilities, which is the best practice for server administration regardless.