Good evening, please I ran the following commands by mistake in my Ubuntu 21.04 machine and then everything became broken...
sudo chown john: /*
sudo chown john: /**
sudo chown john: /**/**
and sudo is no longer working
sudo: /etc/sudo.conf is owned by uid 1000, should be 0
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
EDIT: after referring to /usr/bin/sudo must be owned by uid 0 and have the setuid bit set and Sudo doesn't work: "/etc/sudoers is owned by uid 1000, should be 0" I ran the following commands in Live USB it worked again...
sudo chown root:root /* -R
sudo chown root:root /** -R
sudo chown root:root /**/** -R
sudo chown root:root /usr/bin/** -R
sudo chown root:root /usr/bin/**/** -R
sudo chown root:root /etc/sudoers /etc/sudoers.d /etc/sudo.conf -R
sudo chmod 4755 /etc/sudoers
sudo chmod 4755 /etc/sudo.conf
sudo chown root:root /usr/bin/sudo
sudo chmod 4755 /usr/bin/sudo
sudo chown root:root /usr/lib/sudo/sudoers.so
sudo chmod 4755 /usr/lib/sudo/sudoers.so
EDIT 2: and the following commands too...
sudo chmod 4755 /usr/libexec/**
sudo chown root:root /usr/libexec/**
sudo chmod 4755 /usr/libexec/polkit-agent-helper-1
ls
in order to see what will be impacted by your command before committing yourself. – graham Oct 10 '21 at 16:37