1

I mistakenly excuted:

$ sudo chmod -R 777 /*

I can not run sudo any more: I have tried changing the permissions with recovery mode but when I log in back into my account sudo is not still working.

1 Answers1

2

I do agree that a re-install will be easier and it will have a predicted result (a total recreation of all permissions) but it is possible to do this without a re-install using "acl". On the desktop editions "acl" is installed by default.

Now the problem is that because you messed up "sudo" and probably did not create a collection of permissions you will need an outside source. If you have another system you can make these files yourself with the command below. If you do not have a 2nd machine I created a permissions file of all the files in /usr/ (/etc/ and /var/ are included below too) with

getfacl -R / > /tmp/permissions_usr.acl

and uploaded it to dropbox (12Mb). Download it and store it somewhere (I will assume /tmp/)With the command

setfacl --restore=/tmp/permissions_usr.acl

you can restore the file properties. But you will need a root prompt for this so will have to reboot into recovery mode from grub (see How do I boot into recovery mode?)


Same permissions file created for


These 3 files are all like this:

$more permissions_etc.acl 
# file: etc
# owner: root
# group: root
user::rwx
group::r-x
other::r-x

# file: etc/signond.conf
# owner: root
# group: root
user::rw-
group::r--
other::r--

# file: etc/hp
# owner: root
# group: root
user::rwx
group::r-x
other::r-x

...
Rinzwind
  • 309,379