Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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: sysadminnotebook.blogspot.cz/2012/06/… It would be great if some of them work and you put them as a reply here. –  pabouk Nov 15 '13 at 9:29
add comment

2 Answers

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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.