Answers for "polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie"

0

polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie

I ran into this problem also and with some digging, found a working solution. 
The original solution is from this github issue for NixOS by EstalillaJ.

1. Open two ssh sessions to the target server.

2. In the first session, get the PID of bash by running:
	echo $$

3. In the second session, start the authentication agent with:
	pkttyagent --process (pid from step 2)

4. Back in the first session, run:
	pkexec chown root:root /etc/sudoers /etc/sudoers.d -R
    
    or
    
    pkexec visudo

5. In the second session, you will get the password prompt. visudo will start 
in the first session.
Posted by: Guest on August-04-2021

Code answers related to "polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie"

Browse Popular Code Answers by Language