2

I changed the permission for /etc folder to 777 with chmod. When I try to run Sudo after that it refuses to work. I found a few fix, such as going to recovery mode to fix things but recovery mode is not an option for me as Grub is not loading at all. Even holding shift key or repeat Esc does not load Grub. I tried to update grub but again, that requires sudo! http://www.psychocats.net/ubuntu/fixsudo

r2d2@Sdnhbuz-r2d2:~$ sudo update-grub
sudo: /etc/sudoers is world writable
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
  • as far as I understand; GNU GRUB (GRand Unified Bootloader) is loading but you can not override default time out configuration and reach GNU GRUB Menu (user interface). Just being curious, why did you change the permissions of a folder which stands for host-specific system configuration? – Hilmi Erdem KEREN Jun 26 '15 at 11:29

1 Answers1

1

If you changed permissions recursively (with -R option) then you have a problem, because you have to restore the right permission for each file. If you only changed etc folder permission it is easy to solve.

Download and burn the ubuntu install cd (it is a live-cd).

Insert a live-cd (or a live-usb) in your computer and boot the machine using it (remember to tell your computer/bios to start from the cd/usb if it is not the first option).

Do not select "install ubuntu", select "try ubuntu".

With the live ubuntu running, mount your computer disk and change permissions.

If you don't known how to do it. You can open a terminal (or press Ctrl-Alt-t) and execute

sudo fdisk -l

This will list all your disks and partitions. Normally your computer disk will be /dev/sda and the main partition will be the greatest linux partition (I assume /dev/sda1). Then execute:

sudo mount /dev/sda1 /mnt

Don't worry, you are running the live ubuntu and sudo will work. Now go into mnt:

cd /mnt

and restore the permissions:

sudo chmod 755 etc

Now close the terminal, shutdown the live ubuntu and restart from your computer (eject the cd/usb before restart).

You can follow this process with any linux live-cd.

acesargl
  • 176