/etc/sudoers file corrupted and I can't run 'pkexec visudo' over SSH
Following the instruction here I get:
pkexec visudo
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
Authentication is needed to run `/usr/sbin/visudo' as the super user
Authenticating as: Thomas,,, (tuc) 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
This incident has been reported.
I am doing this via ssh since the box I am doing this on is used as a music server with no screen and is rather inaccessible.
This happened when I upgraded from Ubuntu 14.04 to 16.04. I tried to copy a sudoers file from another recent 16.04 installation, but I can't do that because of the sudoers file:
sudo mv ~/gyrf sudoers
>> /etc/sudoers: syntax error near line 36 <<<
>> /etc/sudoers: syntax error near line 37 <<<
>> /etc/sudoers: syntax error near line 38 <<<
>> /etc/sudoers: syntax error near line 39 <<<
>> /etc/sudoers: syntax error near line 40 <<<
>> /etc/sudoers: syntax error near line 41 <<<
>> /etc/sudoers: syntax error near line 42 <<<
>> /etc/sudoers: syntax error near line 43 <<<
>> /etc/sudoers: syntax error near line 44 <<<
>> /etc/sudoers: syntax error near line 45 <<<
>> /etc/sudoers: syntax error near line 46 <<<
>> /etc/sudoers: syntax error near line 47 <<<
>> /etc/sudoers: syntax error near line 48 <<<
>> /etc/sudoers: syntax error near line 49 <<<
sudo: parse error in /etc/sudoers near line 36
sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin
Should I go get the box from the attic and try pkexec visudo
or is something else wrong here?
16.04 ssh sudo policykit pkexec
add a comment |
Following the instruction here I get:
pkexec visudo
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
Authentication is needed to run `/usr/sbin/visudo' as the super user
Authenticating as: Thomas,,, (tuc) 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
This incident has been reported.
I am doing this via ssh since the box I am doing this on is used as a music server with no screen and is rather inaccessible.
This happened when I upgraded from Ubuntu 14.04 to 16.04. I tried to copy a sudoers file from another recent 16.04 installation, but I can't do that because of the sudoers file:
sudo mv ~/gyrf sudoers
>> /etc/sudoers: syntax error near line 36 <<<
>> /etc/sudoers: syntax error near line 37 <<<
>> /etc/sudoers: syntax error near line 38 <<<
>> /etc/sudoers: syntax error near line 39 <<<
>> /etc/sudoers: syntax error near line 40 <<<
>> /etc/sudoers: syntax error near line 41 <<<
>> /etc/sudoers: syntax error near line 42 <<<
>> /etc/sudoers: syntax error near line 43 <<<
>> /etc/sudoers: syntax error near line 44 <<<
>> /etc/sudoers: syntax error near line 45 <<<
>> /etc/sudoers: syntax error near line 46 <<<
>> /etc/sudoers: syntax error near line 47 <<<
>> /etc/sudoers: syntax error near line 48 <<<
>> /etc/sudoers: syntax error near line 49 <<<
sudo: parse error in /etc/sudoers near line 36
sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin
Should I go get the box from the attic and try pkexec visudo
or is something else wrong here?
16.04 ssh sudo policykit pkexec
AFAIKpkexec
only allows this for a local user (not an SSH remote user) - so yes it should work from the attic
– steeldriver
Jul 17 '16 at 11:29
Either get the box, or get the drive, mount it in another computer and editsudoers
to suit. Depends on whats easiest.
– vidarlo
Jun 19 '18 at 23:27
@steeldriverIt It just worked to me as a remote user. JFYI.
– php-coder
10 hours ago
add a comment |
Following the instruction here I get:
pkexec visudo
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
Authentication is needed to run `/usr/sbin/visudo' as the super user
Authenticating as: Thomas,,, (tuc) 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
This incident has been reported.
I am doing this via ssh since the box I am doing this on is used as a music server with no screen and is rather inaccessible.
This happened when I upgraded from Ubuntu 14.04 to 16.04. I tried to copy a sudoers file from another recent 16.04 installation, but I can't do that because of the sudoers file:
sudo mv ~/gyrf sudoers
>> /etc/sudoers: syntax error near line 36 <<<
>> /etc/sudoers: syntax error near line 37 <<<
>> /etc/sudoers: syntax error near line 38 <<<
>> /etc/sudoers: syntax error near line 39 <<<
>> /etc/sudoers: syntax error near line 40 <<<
>> /etc/sudoers: syntax error near line 41 <<<
>> /etc/sudoers: syntax error near line 42 <<<
>> /etc/sudoers: syntax error near line 43 <<<
>> /etc/sudoers: syntax error near line 44 <<<
>> /etc/sudoers: syntax error near line 45 <<<
>> /etc/sudoers: syntax error near line 46 <<<
>> /etc/sudoers: syntax error near line 47 <<<
>> /etc/sudoers: syntax error near line 48 <<<
>> /etc/sudoers: syntax error near line 49 <<<
sudo: parse error in /etc/sudoers near line 36
sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin
Should I go get the box from the attic and try pkexec visudo
or is something else wrong here?
16.04 ssh sudo policykit pkexec
Following the instruction here I get:
pkexec visudo
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
Authentication is needed to run `/usr/sbin/visudo' as the super user
Authenticating as: Thomas,,, (tuc) 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
This incident has been reported.
I am doing this via ssh since the box I am doing this on is used as a music server with no screen and is rather inaccessible.
This happened when I upgraded from Ubuntu 14.04 to 16.04. I tried to copy a sudoers file from another recent 16.04 installation, but I can't do that because of the sudoers file:
sudo mv ~/gyrf sudoers
>> /etc/sudoers: syntax error near line 36 <<<
>> /etc/sudoers: syntax error near line 37 <<<
>> /etc/sudoers: syntax error near line 38 <<<
>> /etc/sudoers: syntax error near line 39 <<<
>> /etc/sudoers: syntax error near line 40 <<<
>> /etc/sudoers: syntax error near line 41 <<<
>> /etc/sudoers: syntax error near line 42 <<<
>> /etc/sudoers: syntax error near line 43 <<<
>> /etc/sudoers: syntax error near line 44 <<<
>> /etc/sudoers: syntax error near line 45 <<<
>> /etc/sudoers: syntax error near line 46 <<<
>> /etc/sudoers: syntax error near line 47 <<<
>> /etc/sudoers: syntax error near line 48 <<<
>> /etc/sudoers: syntax error near line 49 <<<
sudo: parse error in /etc/sudoers near line 36
sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin
Should I go get the box from the attic and try pkexec visudo
or is something else wrong here?
16.04 ssh sudo policykit pkexec
16.04 ssh sudo policykit pkexec
edited Apr 13 '17 at 12:24
Community♦
1
1
asked Jul 17 '16 at 10:11
Thomas Ulrich ChristiansenThomas Ulrich Christiansen
5614
5614
AFAIKpkexec
only allows this for a local user (not an SSH remote user) - so yes it should work from the attic
– steeldriver
Jul 17 '16 at 11:29
Either get the box, or get the drive, mount it in another computer and editsudoers
to suit. Depends on whats easiest.
– vidarlo
Jun 19 '18 at 23:27
@steeldriverIt It just worked to me as a remote user. JFYI.
– php-coder
10 hours ago
add a comment |
AFAIKpkexec
only allows this for a local user (not an SSH remote user) - so yes it should work from the attic
– steeldriver
Jul 17 '16 at 11:29
Either get the box, or get the drive, mount it in another computer and editsudoers
to suit. Depends on whats easiest.
– vidarlo
Jun 19 '18 at 23:27
@steeldriverIt It just worked to me as a remote user. JFYI.
– php-coder
10 hours ago
AFAIK
pkexec
only allows this for a local user (not an SSH remote user) - so yes it should work from the attic– steeldriver
Jul 17 '16 at 11:29
AFAIK
pkexec
only allows this for a local user (not an SSH remote user) - so yes it should work from the attic– steeldriver
Jul 17 '16 at 11:29
Either get the box, or get the drive, mount it in another computer and edit
sudoers
to suit. Depends on whats easiest.– vidarlo
Jun 19 '18 at 23:27
Either get the box, or get the drive, mount it in another computer and edit
sudoers
to suit. Depends on whats easiest.– vidarlo
Jun 19 '18 at 23:27
@steeldriverIt It just worked to me as a remote user. JFYI.
– php-coder
10 hours ago
@steeldriverIt It just worked to me as a remote user. JFYI.
– php-coder
10 hours ago
add a comment |
1 Answer
1
active
oldest
votes
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.
- Open two ssh sessions to the target server.
In the first session, get the PID of bash 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 the password prompt. visudo will start in the first session.
2
Holy shit dude, u saved my life! thx :D
– Roger Barretto
Jul 31 '18 at 22:01
that is crazy, it works perfect! and no need to reboot the system
– undefinedman
Oct 16 '18 at 18:02
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f799669%2fetc-sudoers-file-corrupted-and-i-cant-run-pkexec-visudo-over-ssh%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
- Open two ssh sessions to the target server.
In the first session, get the PID of bash 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 the password prompt. visudo will start in the first session.
2
Holy shit dude, u saved my life! thx :D
– Roger Barretto
Jul 31 '18 at 22:01
that is crazy, it works perfect! and no need to reboot the system
– undefinedman
Oct 16 '18 at 18:02
add a comment |
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.
- Open two ssh sessions to the target server.
In the first session, get the PID of bash 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 the password prompt. visudo will start in the first session.
2
Holy shit dude, u saved my life! thx :D
– Roger Barretto
Jul 31 '18 at 22:01
that is crazy, it works perfect! and no need to reboot the system
– undefinedman
Oct 16 '18 at 18:02
add a comment |
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.
- Open two ssh sessions to the target server.
In the first session, get the PID of bash 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 the password prompt. visudo will start in the first session.
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.
- Open two ssh sessions to the target server.
In the first session, get the PID of bash 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 the password prompt. visudo will start in the first session.
answered Jul 9 '18 at 18:41
Satyen A.Satyen A.
14113
14113
2
Holy shit dude, u saved my life! thx :D
– Roger Barretto
Jul 31 '18 at 22:01
that is crazy, it works perfect! and no need to reboot the system
– undefinedman
Oct 16 '18 at 18:02
add a comment |
2
Holy shit dude, u saved my life! thx :D
– Roger Barretto
Jul 31 '18 at 22:01
that is crazy, it works perfect! and no need to reboot the system
– undefinedman
Oct 16 '18 at 18:02
2
2
Holy shit dude, u saved my life! thx :D
– Roger Barretto
Jul 31 '18 at 22:01
Holy shit dude, u saved my life! thx :D
– Roger Barretto
Jul 31 '18 at 22:01
that is crazy, it works perfect! and no need to reboot the system
– undefinedman
Oct 16 '18 at 18:02
that is crazy, it works perfect! and no need to reboot the system
– undefinedman
Oct 16 '18 at 18:02
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f799669%2fetc-sudoers-file-corrupted-and-i-cant-run-pkexec-visudo-over-ssh%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
AFAIK
pkexec
only allows this for a local user (not an SSH remote user) - so yes it should work from the attic– steeldriver
Jul 17 '16 at 11:29
Either get the box, or get the drive, mount it in another computer and edit
sudoers
to suit. Depends on whats easiest.– vidarlo
Jun 19 '18 at 23:27
@steeldriverIt It just worked to me as a remote user. JFYI.
– php-coder
10 hours ago