I'm not sure. I'm not doing anything at the moment, just thinking out aloud.
- I've answered a few questions on "chmod/chown-gone-wild" questions and I usually lean towards reinstallation. It's faster and safer.
- But I'm normally talking about system-wide changes.
/var/ that is most complex.
- Most other directories are a much more simple
root: pattern until you get to
But even in
/usr/, there are outliers:
$ sudo find /usr/ -not \( -user 0 -group 0 \) -not -path "/usr/*/node_modules/*" -not -path "/usr/local/lib/python*" -printf "%p,%u:%g\n" | grep -viE "(squeeze|rabbitmq|nginx|lxc|postfix)" | sort -u | column -t -c 80 -s ,
Some of this is common some is crank from my computer. Note I excluded node_modules (which was appalling) and similarly python (abused by
sudo pip3 over the years). These were thousands of files owned by $USER.
So what next?
I'm not sure. Is that answer good enough that our collective advice to people changes from You Done Messed Up A-Aron! to You can fix it?
I can't speak for this user's system before the incident, but whenever people deliberately start tearing down walls in the permissions, I worry about the other things they've done to get where they are.
I'd personally probably still recommend backup and reinstall.