Few days I ago, I had a funny situation. Colleague of mine accidentally executed:
sudo chown -R www-data:www-data /*so instead for current directory ./* he changed owner for entire root file system. Sure, he tried to change back owner to the root:root , but root did not have any permissions anymore, since /bin is owned by another user.
Fortunately, this kind of mess on Linux systems we can fix very quickly using Live CD. So reboot your system and run Live CD.
Mounting a File System
First you need to mount the partition your Ubuntu installation is on. It will be something like sda1 or sda6 , if you are not sure about drive letter or partition number you can check it using GParted which is included in the Live CD. You mount partition simply by execution mount command:
sudo mkdir /mnt/ubuntusudo mount /dev/sdXY /mnt/ubuntuChrooting
Now you need to bind these directories to the chroot:
sudo mount --bind /dev /mnt/ubuntu/dev &&sudo mount --bind /dev/pts /mnt/ubuntu/dev/pts &&sudo mount --bind /proc /mnt/ubuntu/proc &&sudo mount --bind /sys /mnt/ubuntu/sysAnd finally you can enter in using chroot:
sudo chroot /mnt/ubuntu /bin/bashNow you can fix whatever you want in your system, in this case I restored root as owner.