Skip to content

Is it possible to interact with systemd system units as non-root user? (Authentication?) #425

@patrickjane

Description

@patrickjane

I have my program running as non-root user, and I use NewSystemConnectionContext() to create a connection to systemd via dbus. I can query the status of services via GetUnitPropertiesContext(), however when I want to start/stop/restart something via e.g. StartUnitContext() I get the error: "Interactive authentication required."

Of course when working with the CLI one would normally just sudo systemctl start ..., however programmatically this is not possible. Does this library support any means of authentication whatsoever? I could not find any hints regarding this.

I want to avoid running my program as root as this would open up quite a few security issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions