My fingers decided to betray me and press the enter key a moment too soon, and I have managed to run chmod -R 777 /
across a whole drive. I have no physical access to the device.
I do however, still have a connected session where I am root and a clone-ish (minus web content) server which I guess I could probably dump permissions from i.e
./var/www/htdocs/ckeditor/plugins/link/images/hidpi:
total 12
drwxrwxrwx 2 user user 4096 Aug 27 20:43 .
drwxrwxrwx 3 user user 4096 Aug 27 20:43 ..
-rwxrwxrwx 1 user user 1597 Sep 6 20:51 anchor.png
./var/www/htdocs/ckeditor/plugins/liststyle:
total 12
drwxrwxrwx 3 user user 4096 Aug 27 20:40 .
drwxrwxrwx 32 user user 4096 Aug 27 20:41 ..
drwxrwxrwx 2 user user 4096 Aug 27 20:40 dialogs
./var/www/htdocs/ckeditor/plugins/liststyle/dialogs:
total 12
drwxrwxrwx 2 user user 4096 Aug 27 20:40 .
drwxrwxrwx 3 user user 4096 Aug 27 20:40 ..
-rwxrwxrwx 1 user user 2939 Sep 6 20:48 liststyle.js
Is there any way to utilize these two facts to undo the damage? Is it possible to build a script to harvest that data and use it to set permissions?