You are not logged in.

#1 2017-07-09 22:25:38

agve
Member
Registered: 2017-07-09
Posts: 14

[SOLVED] Accidentally messed up sudo..?

`sudo: /etc/sudoers.d is owned by uid 1000, should be 0`
is what I get, after that it asks for a password, but neither my user or the root password work.

This happened when I was installing lightdm-gtk-greeter-setting via yaourt. The package asked me for my root password.

I tried:
`su - root`
`chmod 440 /etc/sudoers`
`chown root:root /etc/sudoers`
But that didn't work.

Then I tried:
`pkexec chown root:root /etc/sudoers /etc/sudoers.d -R`
Now I can do sudo commands as a regular user but after I execute the command it's not doing anything, when I do CTRL+C to stop it, only then does it ask for my password but entering it does nothing as I've already stopped it.

Last edited by agve (2017-07-10 12:53:31)

Offline

#2 2017-07-10 00:03:49

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: [SOLVED] Accidentally messed up sudo..?

This is very weird. I want to make some sanity checks first. Can you share your pacman.log please? And your pacman.conf too if you're feeling generous.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#3 2017-07-10 05:11:06

Shotman
Member
Registered: 2017-04-04
Posts: 6

Re: [SOLVED] Accidentally messed up sudo..?

agve wrote:

Now I can do sudo commands as a regular user but after I execute the command it's not doing anything, when I do CTRL+C to stop it, only then does it ask for my password but entering it does nothing as I've already stopped it.

if you try:

 echo password | sudo -S command

which passes the password to sudo directly, does it work?

Offline

#4 2017-07-10 06:06:31

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,878

Re: [SOLVED] Accidentally messed up sudo..?

stat /usr/bin/sudo

And what have you done to get the sudoers owned by you?
If you followed some sick advise and did some recursive chown on the entire filesystem: re-install linux.

Online

#5 2017-07-10 12:53:21

agve
Member
Registered: 2017-07-09
Posts: 14

Re: [SOLVED] Accidentally messed up sudo..?

After my second restart it magically fixed itself, no clue.

Offline

#6 2017-07-10 19:49:15

Shotman
Member
Registered: 2017-04-04
Posts: 6

Re: [SOLVED] Accidentally messed up sudo..?

seth wrote:

If you followed some sick advise and did some recursive chown on the entire filesystem: re-install linux.

A reinstall isn't necessary, even in those circumstances (trust me, I did it by accident a couple of years ago). You can fix ownership and permissions for most stuff on a per directory basis, and then fix the odd "different" file or directory as you go.

Offline

#7 2017-07-10 20:15:49

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,878

Re: [SOLVED] Accidentally messed up sudo..?

Yes, *you* can, but if somebody "intentionally" chowned your entire filesystem, somebody is usually better off with a reinstallation, rather than making things even worse.
The efficient approach is btw. to  utilize the pacman mtree information ;-)

Online

Board footer

Powered by FluxBB