Score:1

Make systemd ask for password and authenticate instead of just denying access

fr flag

When I run a command like this on my raspberry pi I get the following output:

$ service sshd restart
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to restart »sshd.service«.
Authenticating as: ,,, (pi)
Password:

Doing the same on my Ubuntu Focal server I am getting a completely different result:

$ service sshd restart
Failed to restart sshd.service: Interactive authentication required.
See system logs and 'systemctl status sshd.service' for details.

I have tried to compare the polkit configuration to see why the raspberry is giving me a chance to authenticate while my server does not, forcing me to add the sudo and then run the command again as root.

On both systems the user I am using is in the sudo group, the linux server has

[Configuration]
AdminIdentities=unix-group:sudo;unix-group:admin

in a file in it's localauthority.conf.d, similar for the raspberry. I am not sure what is causing the behaviour on the raspberry, but on Ubuntu something causes it to fail immediately instead of asking me for authentication. Apparently someone at https://askubuntu.com/questions/1114351/why-system-keep-ask-to-enter-password-for-the-first-member-of-sudo-group-instead has the same result that I am having and there the issue was pinned down to the file /usr/share/polkit-1/actions/org.freedesktop.systemd1.policy, so I have compared the file on both systems, and it's the same

fr flag
@A.B Thanks, I have changed that. I thought both mean the same.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.