Issue
(Accidental) Action
Hi, I am not very well versed in Linux but using Ubuntu for more than a year.
Couple of days back I accidentally changed the ownership of my root folder while changing ownership of another non-root directory. I am not sure but as far as I remember, I executed sudo chown -R root:root /bin
accidentally.
The Consequences
Now I am unable to do anything that requires sudo
. This is the error I am getting while performing any such task:
max@max-ThinkPad-T430:~/Desktop$ sudo chown -R root:root /bin
sudo: /etc/sudoers is owned by uid 1000, should be 0
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
Question
What's the solution to bring back the sudo
working exactly as it was before the incident.
Solution
I would recommend creating a bootable disk (CD, DVD or USB Drive) using the "Startup Disk Creator" (/usr/bin/usb-creator-gtk
) and a recent Ubuntu Desktop .iso file, available from http://www.ubuntu.com/download/desktop/.
Once you have created the startup disk, reboot your computer and ensure that you boot from the startup disk. I assume you know how to do that given that you have installed Ubuntu before.
Don't choose the "Install Ubuntu" mode, just use the "Try It Out" mode to get to a desktop environment. From there you should be able to mount your existing Ubuntu setup and chown root /etc/sudoers
so that your sudo command will work again.
Reboot to your real Ubuntu installation and try sudo ls
, it should work now.
Answered By - Kaoru Answer Checked By - Terry (WPSolving Volunteer)