Linux EACCESMedium

systemctl permission denied: causes and ways to fix the access error

The article explains why the 'Permission denied' error occurs when running systemctl and provides proven ways to fix it, including using sudo and configuring polkit.

Updated at February 17, 2026
5-10 minutes
Easy
FixPedia Team
Применимо к:systemd 219 and aboveUbuntu 16.04 and aboveDebian 8 and aboveCentOS 7 and above

What the "Permission denied" error in systemctl means

When attempting to run a systemctl command (e.g., systemctl start nginx) without sufficient privileges, you see the message:

Failed to connect to bus: Permission denied

or

systemctl: authorization denied

This error indicates that the current user is not authorized to interact with systemd via D-Bus. Systemctl is designed to manage system services, so by default it requires root privileges (or sudo). The error occurs at the polkit authorization level, not at the filesystem level.

Common causes

The "Permission denied" error when using systemctl can be caused by the following:

  1. Running without sudo: Executing the command as a regular user without privilege escalation.
  2. User not in sudo/wheel group: The account is not added to the sudo group (Ubuntu/Debian) or wheel group (CentOS/RHEL/Fedora), so sudo is unavailable.
  3. Polkit restrictions: Polkit (PolicyKit) rules explicitly deny your user or session access to systemd actions.
  4. Running in a container or systemd-less environment: In a Docker container, WSL1, or other isolated environments, systemd may not be running as PID 1, so systemctl cannot connect to the bus.
  5. Incorrect permissions on systemd files: A rare case where files in /etc/systemd/ or /run/systemd/ have incorrect permissions (e.g., not readable for regular users).

Solutions

Solution 1: Use sudo for systemctl commands

The simplest and correct solution is to run all service management commands with elevated privileges by prefixing them with sudo.

Example:

sudo systemctl start nginx
sudo systemctl status nginx
sudo systemctl enable nginx

If sudo is configured to request a password, the system will ask for your user's password. If sudo is configured without a password for specific commands (via /etc/sudoers), the command will execute automatically.

💡 Tip: For frequent operations, you can create aliases in ~/.bashrc, e.g., alias sstart='sudo systemctl start', but be careful not to accidentally run dangerous commands.

Solution 2: Add the user to the sudo or wheel group

If using sudo results in an error like "user is not in the sudoers file", you need to add your user to the appropriate group.

  1. Check which groups the current user belongs to:
groups $USER
  1. If the output does not include sudo (for Debian/Ubuntu) or wheel (for RHEL/CentOS/Fedora), add the user:

For Ubuntu/Debian:

sudo usermod -aG sudo $USER

For CentOS/RHEL/Fedora:

sudo usermod -aG wheel $USER
  1. Important: Changes take effect after logging out and back in (or after a reboot). Verify again with the groups $USER command.

Solution 3: Configure polkit rules for passwordless access

In some scenarios (e.g., on workstations), you may want to allow specific users to perform certain systemctl actions without a password. This is done via polkit (PolicyKit).

  1. Create a rule file, e.g., /etc/polkit-1/rules.d/50-systemctl.rules. Root privileges are required.
  2. Add JavaScript code that grants service management permissions to specific users or groups. Example for user alice:
polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.systemd1.manage-units" &&
        subject.user == "alice") {
        return polkit.Result.YES;
    }
});

Or for the developers group:

polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.systemd1.manage-units" &&
        subject.user in ["alice", "bob"]) {
        return polkit.Result.YES;
    }
});
  1. Restart polkit or the entire system:
sudo systemctl restart polkit

⚠️ Important: Configuring polkit rules reduces security. Only grant necessary actions (e.g., org.freedesktop.systemd1.manage-units) and only to trusted users. Do not use polkit.Result.YES for all actions (action.id).

Solution 4: Workaround for Docker containers

In Docker containers, systemctl usually doesn't work because systemd is not running as the init process (PID 1). Therefore, attempts to use systemctl will result in a bus connection error.

Solution A: Run the container in privileged mode or with systemd

docker run --privileged -d your_image

Or configure the container to start systemd as PID 1 (requires changes to the image, e.g., installing systemd and configuring the entrypoint).

Solution B: Manage services without systemctl

Instead of systemctl, use direct process management commands or init scripts. For example, to start nginx in a container:

docker exec -d container_name nginx

Or rebuild the image so services start via CMD or ENTRYPOINT.

Solution C: Connect to the host's systemd from the container (advanced)

Mount systemd and dbus sockets into the container:

docker run -v /run/dbus:/run/dbus -v /var/run/docker.sock:/var/run/docker.sock ...

However, this may be insecure and requires additional sudo configuration inside the container.

Solution 5: Check and fix systemd file permissions

If the error is caused by corrupted permissions on systemd files (rare), restore the default permissions.

Warning: Do not change permissions on system files without understanding the consequences. First, make a backup or confirm the issue is indeed permissions-related.

For Debian/Ubuntu, you can reconfigure the systemd package:

sudo dpkg-reconfigure systemd

Or force-restore permissions (use with caution!):

sudo chmod -R 755 /etc/systemd
sudo chmod -R 755 /run/systemd

If the problem persists, consider reinstalling systemd:

sudo apt-get install --reinstall systemd  # for Debian/Ubuntu
sudo yum reinstall systemd               # for CentOS/RHEL

Prevention

To avoid repeatedly encountering the "Permission denied" error with systemctl:

  • Always use sudo for commands that manage system services, unless you are logged in as root.
  • Do not grant excessive privileges via sudoers or polkit. The principle of least privilege reduces risks.
  • Avoid using systemctl in containers unless the container is specifically designed for it. Use alternative process management methods.
  • Keep your system updated to receive fixes for systemd and polkit that may resolve authorization bugs.
  • Check group membership after creating new users, especially on servers where remote service management is required.

F.A.Q.

Why does systemctl require administrator privileges?
Can systemctl be configured to work without sudo?
What to do if sudo doesn't help?
Does this error occur in Docker containers?

Hints

Run the command with sudo
Add the user to the sudo group
Configure polkit if necessary
For containers, use privileged mode
FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community