I did it… I guess everyone does it sometime, but this was my first. I executed
sudo chown -R /usr/bin and before I realized my mistake, it was too late… Now I can't access sudo because I receive the following error:
sudo: must be setuid root. I would really appreciate if I could avoid a complete reinstall of ubuntu because that would require far too much work 🙁
Here is the commands I've tried without success (in recovery mode):
chown root:root /usr/bin/sudo chmod 4755 /usr/bin/sudo
I've also tried
chmod 0440 /etc/sudoers all without success. Any ideas about what I can try to fix it?
NOTE: Sorry for creating another one of these threads, but since I knew the exact command I executed to blow it all up, I thought that might make a difference 🙂
Just use any live cd to boot into recovery and then select the hard disk and navigate to the bin folder of your installed ubuntu. Then reset the permissions like this: go to the root console. Once there, execute the following to return permissions back:
EDIT: Just go to terminal from any live cd and write there:
This will list out all the partitions. Just locate the root partition of the drive and write down its device name. It will have the device listed out in order:
Just note down the device name of your root partition, let you can use Gparted to examine the partitons in a better way. But finding out the root partition is what you all care about. Now suppose /sda2 is your root partition(I assume). Just go to terminal and mount the device by
Now when you get your device mounted, Just navigate to it as:
and note down the root device serial number
and now you can cd to bin directory and can apply permission there.