0

I did the command

chmod -R www-data:www-data /

But after that, nothing worked. So i found on the internet that you can returen back to your default permissions with:

perl -0ne '$_ =~ m{^(\d*\d\d\d) (.*)\0$} ; print "chmod $1 $2\n" ; chmod oct($1), $2 ;' working-permissions.txt

But is there some that could work with the groupowners?

1
  • 1
    Please add a few lines from "working-permissions.txt" The contents of that file are used to recreate those permissions. The $1 and $2 will be a column in that file where $1 is the permission and $2 the file name. Rename "chmod" to "chgrp" but that will not be correct for all files: the $1 is probably going to be 1 column to the right. – Rinzwind May 14 '20 at 7:21
1

You probably mean you used the chown command. The command you provide is invalid.

If that is indeed the case you will find that the question is pretty much similar to this one: https://unix.stackexchange.com/questions/48845/how-to-revert-chown-command.

It turns out there is indeed not an easy fix for this. You will probably have to spend time manually restoring ownership of many files and folders, accessing them though a recovery drive. Something like this: http://www.system-rescue-cd.org.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.