D
D
Dim Boy2018-10-18 21:58:55
linux
Dim Boy, 2018-10-18 21:58:55

How to make pkexec visudo work?

Slam file

>>> /etc/sudoers: syntax error near line 33 <<<
sudo: parse error in /etc/sudoers near line 33
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

according to the manuals, doing pkexec visudo
I get:
[email protected]:~$ pkexec visudo
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
Authentication is needed to run `/usr/sbin/visudo' as the super user
Authenticating as: ,,, (user)
Password: enter user password
polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freed esktop.PolicyKit1.Error.Failed: No session for cookie
==== AUTHENTICATION FAILED ===
Error executing command as another user: Not authorized

are there any options?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
evildevel, 2020-06-03
@evildevel

Open two SSH sessions
In the first session, get the bash PID by running:
echo $$
In the second session, start the authentication agent with:
pkttyagent --process (pid from step 2)
Back in the first session, run:
pkexec visudo
In the second session, you will get a prompt password. Visudo will start in the first session.

D
Dmitry Shitskov, 2018-10-19
@Zarom

visudo had to be used before it broke (so as not to break).
Now option 1 is to login as root .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question