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.
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.
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
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.