Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I undo the following command:

chmod -R a+rwX /

I used it to modify some permissions, but it did not do as I had expected. I want to undo it, or at least reverse it.

share|improve this question
Here are possible solutions for systems based on Debian:… It would be great if some of them work and you put them as a reply here. – pabouk Nov 15 '13 at 9:29

Your best bet would be to restore from backup, as there isn't an "undo" feature for this type of command.

To otherwise reverse it, you would need to know what the previous permissions where and reapploy them.

share|improve this answer

There is no undo for this. Just removing world write recursively won't work, since some directories need to be world writable. I checked a newly installed ubuntu system using

sudo find / -xdev  -perm /o+w -a ! -type l -exec ls -dl {} \;

and /tmp, /var/tmp, /var/crash, /var/lib/php5, /var/metrics and a bunch of directories /var/spool/postfix.

There might be programs that refuse to run when their files are world readable (sshd?)

If you have access to another computer running the same os, perhaps you can get the permissions from there. It might even be worth installing to a spare computer. Either way, you'll learn a lot about the find command syntax.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .