Answers for "sudo: /etc/sudoers is owned by uid 1000, should be 0"

0

sudo: /etc/sudoers is owned by uid 1001, should be 0 sudo: no valid sudoers sources found, quitting

Change the owner back to root: chown -R root /etc
Posted by: Guest on July-07-2020
0

sudo: /etc/sudoers is owned by uid 1000, should be 0

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 "sudo: /etc/sudoers is owned by uid 1000, should be 0"

Browse Popular Code Answers by Language