I have a VPS running Ubuntu 16.04

I changed the owner of the root directory (/) recursively to root.

  • I was young and stupid (this happened about an hour ago but never mind).
  • Various things don't work correctly now including a website in the /var/www/html folder.
  • I searched far and wide for a solution but only found either OS-specific instructions which didn't work for me or the instruction to reinstall which, as you might guess, is not what I want to do.
  • I'm looking for a way to restore all file and folder permissions to what they were before without individually finding and changing them.
  • If someone provides a link with instructions which might not be understood by a noob who goes around changing permissions recursively in the root of a linux server then please explain or simplify what the link says.

Thank you all in advance and I hope this issue gets solved as soon as possible.


marked as duplicate by Byte Commander, Zanna, Eric Carvalho, karel, Fabby Mar 17 '18 at 20:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Browse other questions tagged or ask your own question.