Curious to know how you recover from that? How do you what permissions to assign back to files and directories?
More specifically, I used a bunch of these links until I could get a shell, then manually-fixed the rest.
https://askubuntu.com/questions/308939/how-to-reset-default-...
https://askubuntu.com/questions/508359/restore-default-syste...