If you just did sudo chmod 666 /usr
then things are no too bad - since that will have changed the permissions only on the parent /usr
directory, not any of the files of subdirectories within it.
If however you added the recursive flag -R
then you are almost certainly better off re-installing the system. Even so, there should be no reason to lose data: you can boot from a live USB or DVD and backup your important files from there first.
If you only did a non-recursive sudo chmod 666
of the /usr
directory, and you have physical access to the machine, then the simplest fix should be
- Boot into recovery mode via the grub advanced menu and select 'Drop to root shell'
Remount the filesystem in read-write mode
mount -o remount,rw /
Execute the command
chmod 755 /usr
Don't add any other command line options and don't use any shell wildcards.
Type exit
to continue booting normally
Note, chmod
lives in /bin
rather than /usr/bin
so shouldn't be affected by the permissions on /usr
. If (for example) you'd change the permission bits on the /bin
directory, or on the /
directory itself, then this method would not be appropriate since you wouldn't be able to execute chomd
from recovery mode - the best option in that case would probably be to boot a live CD/DVD/USB of any available Linux distribution (it doesn't need to be Ubuntu); identify and mount the broken system's root device (at /mnt
in the live system, for example); and then run chmod 755 /mnt/usr
from the live system.
chmod
command with-R
?chmod
from there.chmod 666 /usr
there's no reasonbin
should have changed. Do what @steeldriver suggested and use Recovery (enter through GRUB).cd usr chmod 755 *
- that will make things MUCH worse