user@host01:~$ sudo su >>> /etc/sudoers: syntax error near line 23 <<< sudo: parse error in /etc/sudoers near line 23 sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin user@host01:~$
The internet suggests to use "pkexec bash" which should get a root shell... but it does not work either:
polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
All lost ? reboot in safe mode ? Unfortunately machine is very far away.
Turns out not all is lost. First, in the current session issue "echo $$" and note the PID.
Then make *another* session, and there issue "pkttyagent --process PID_FROM_PREVIOUS_STEP". It will ask for your authentication and will start. Then retry in the first terminal. Congrats, now it works. Yay.
Now quickly launch visudo and fix that stupid error... :-)
../ HEADER.txt 01-Jul-2024 21:41 1126