luisserrano
Posts: 28
Joined: Mon Nov 27, 2017 4:49 pm

Accidentaly changed critical ownership. Need help to restore.

Tue Jul 31, 2018 12:39 pm

Hello.

I accidentaly inserted a dot "." before the path in a chown -R command, like this...
Captura.JPG
Captura.JPG (42.94 KiB) Viewed 243 times

And now, I have a lot of system services broken (like vnc, installed wordpress with errors establishing a database connection... ). And this is the bloody screenshot:
Captura2.JPG
Captura2.JPG (109.19 KiB) Viewed 243 times

After this fail I have found Webmin is working and I changed back recursively the ownership for etc, opt, sbin and sys folder to "root:root" But the problem persists. So please, could someone help me to fix/restore this problem?

Thanks in advance.
Last edited by luisserrano on Tue Jul 31, 2018 12:49 pm, edited 2 times in total.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5713
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Accidentaly changed critical ownership. Need help to restore.

Tue Jul 31, 2018 12:48 pm

Oof... it's going to be easier to start with a fresh install. Not all files are meant to be owned by root:root and now you have no way of knowing what they're all meant to be.

You could, in theory, use 'find' on a clean install to find all non-root owned files and use the output from that to fix most of your files. 'debsums' may also help you find messed up permissions.

That doesn't cover 100% of the files though.

luisserrano
Posts: 28
Joined: Mon Nov 27, 2017 4:49 pm

Re: Accidentaly changed critical ownership. Need help to restore.

Tue Jul 31, 2018 1:04 pm

ShiftPlusOne wrote:
Tue Jul 31, 2018 12:48 pm
Oof... it's going to be easier to start with a fresh install. Not all files are meant to be owned by root:root and now you have no way of knowing what they're all meant to be.

You could, in theory, use 'find' on a clean install to find all non-root owned files and use the output from that to fix most of your files. 'debsums' may also help you find messed up permissions.

That doesn't cover 100% of the files though.
Facepalm, dont tell me that. I was actually preparing the system for a full SD cloning and now, this.

I really apreciate your help ShiftPlusOne, thanks. Anyway I will be over here waiting for new possible answers.

Regards.

luisserrano
Posts: 28
Joined: Mon Nov 27, 2017 4:49 pm

Re: Accidentaly changed critical ownership. Need help to restore.

Tue Jul 31, 2018 1:15 pm

Apache is working with no problems (Webmin, PiMonitor...). If I could at least fix the access to MySQL to enter in Wordpress I would be able to backup manually some of my work inside the Wordpress site. Once done, no problem to start from new fresh Raspbian installation.

luisserrano
Posts: 28
Joined: Mon Nov 27, 2017 4:49 pm

Re: Accidentaly changed critical ownership. Need help to restore.

Tue Jul 31, 2018 5:26 pm

New fresh Raspbian installed. Thanks again for help.

Regards.

Return to “Troubleshooting”