pkexec fails with "GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie"
Submitted by Michal Soltys
Assigned to David Zeuthen
When no authentication agents are registered and pkexec falls back to pkttyagent, any attempt to authenticate ends with:
pkexec bash ==== AUTHENTICATING FOR org.freedesktop.policykit.exec === Authentication is needed to run `/usr/bin/bash' as the super user Authenticating as: nozo Password: polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie ==== AUTHENTICATION FAILED === Error executing command as another user: Not authorized
Note that pkexec works fine with any other authentication agent, for example if I preceeded the above with
everything would work fine. By itself, pkttyagent works fine with other commands needing authentication, e.g.
systemctl restart systemd-udevd.service
would execute correctly.
Looks like something is amiss between pkexec and pkttyagent in 0.113. Tested on recent and fully updated Archlinux. For the record, polkit is compiled with following configure line on arch:
./configure --prefix=/usr --sysconfdir=/etc