Running pkexec pwd
gives you:
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
This incident has been reported.
I don't have a graphical polkit agent running, so pkexec
should fallback onto pkttyagent
. However it doesn't seem to work in this case.
Note that to make it work, I have to run pkttyagent
in a different terminal binding to the PID of the first terminal that is running pkexec pwd
, and that terminal will show the same workflow but will have succeeded at authentication. But this shouldn't be necessary as the pkttyagent
should just work on the original terminal when called by pkexec
.
I'm trying to run hdajackretask to get the internal audio working on my system and before I downgraded back to 17.03 I couldn't even get it to run, now that it's running when I try to apply a configuration and type my password root or otherwise I'm getting this error.
Can you explain a bit more how to fix?
Thanks for tip @CMCDragonkai, saved me some investigation time.
@erlandsona It's probably too late but what he means is you should open two terminals.
In the first terminal run the following command to get its PID.
echo $$
In the second terminal run
pkttyagent --process PID_FROM_STEP_1
In the first terminal, do whatever you need to do with pkexec.
saved me right there!
just in case: if you need to do this over ssh just open 2 connections in two terminals and run @EstalillaJ code!
Any news on this?
@concatime see @EstalillaJ's comment that's what worked for me. Hence all the 馃憤 's.
I would rather call his solution a hack until it really get solved ;)
Yeah, i'm still having the same problem. If there is a fix, i'd be happy to know.
This only solution saved me
@EstalillaJ You've just saved my job. I'm grateful
yep same bug. Using Ubuntu 18 LTS and pkexec 0.105
Is this related with bugs.debian.org/cgi-bin/bugreport.cgi?bug=841878?
I use Ubuntu 18.04 with Mate and running /usr/lib/x86_64-linux-gnu/polkit-mate/polkit-mate-authentication-agent-1
solves the problem, but only temporary. Furthermore, when you create another admin user and log into his account, he does not observe any errors.
Perhaps there is a permanent solution for my account? (Besides adding above polkit command to startup programms.)
@EstalillaJ Saved my day
@EstalillaJ Thank you very much!
@EstalillaJ Hit me up next time you're near Seattle / Lynnwood. I owe you a beer.
In my case, it was an Ubuntu 18.04 VPS, after I borked a file under /etc/sudoers.d/. (Nothing to do with NixOS.)
Life saver
Amazing, you save my life.
@EstalillaJ you save me!
It seems that this is due to the authentication agent not running. I am on Ubuntu, but maybe this will help in solving this problem:
I had to install policykit-1-gnome:
sudo apt install policykit-1-gnome
And then run it (same terminal using &, other terminal, or adding it to autostart all worked):
/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1
After that pkexec worked as expected.
Yup, saved my bacon.
Most helpful comment
Thanks for tip @CMCDragonkai, saved me some investigation time.
@erlandsona It's probably too late but what he means is you should open two terminals.
In the first terminal run the following command to get its PID.
In the second terminal run
In the first terminal, do whatever you need to do with pkexec.