Change owner of the root folder and subfolders (Ubuntu 13.04) [closed] Change owner of the root folder and subfolders (Ubuntu 13.04) [closed] unix unix

Change owner of the root folder and subfolders (Ubuntu 13.04) [closed]


I am guessing when you ran the first command you also ended up modifying the ownership of the /usr/bin/sudo executable.

It is saying that effective UID isn't 0 (since root has EUID equal to 0).

So try to change owner of /usr/bin/sudo, and then try change the ownership of other files.


You broke your system pretty badly. Next time be more careful using sudo.

  • Now, start your system using a rescue disk, probably your install disk.
  • Mount your broken file system in the rescue system.
  • Fix the permission/owner stuff.
  • Reboot using your original system.

Depending on how much you changed using that chown, you will have to fix a lot in step 3. You probably might want to have a look at a working proper installation of the same system to find out which user should be the owner of things like /dev/mem etc.

A re-install of the OS might be faster.


:O I offer my condolence!

The problem is that the sudo binary itself must be owned by root. If you have the root password you could just get root to fix the problem:

su

If not, you could boot using a rescue system, mount the partition and

chown root:root /mnt/usr/bin/sudo

or fix the whole problem using the rescue system.

But it will be hard to fix all that ownerships. I would suggest to craft a script that reads the file ownerships from a vanilla installation of your system (having installed the same packages as you) and applies them to the crashed system. (Custom files in the /home/... you'll have to chown yourself) Without such a script it will get really hard but it should be easy to code that