A lot of problems after chown -r user:user /

by vottakvot   Last Updated May 15, 2019 18:02 PM

I've executed this command chown -r user:user /after which I can't perform any sudo command. Also I can't connect to any Network. I want return all back. But how?

Answers 2

Since you are unable to use sudo You would have to boot from a liveusb installation and change all of the permissions back from there.

As mentioned in Thomas Wards comment above, it would most likely be easier to use the liveusb to backup your data and then just reinstall the system

May 15, 2019 17:41 PM

If you ran this as non-superuser (without sudo and just your own user), you probably didn't do too much damage because outside your own user directory and maybe some bits of /tmp/ (which you can probably fix with a reboot), your user wouldn't have the permissions to chagne things much.

However, if you ran this as sudo or as the root user, you're literally hosed.

Attempting to revert that amount of damage is a lesson in futility and self-punishment, as you'd have to have an exemplar clean system to know how to reset the ownership and permissions to. You'd also have to go directory by directory and file-by-file which is a VERY lengthy and nontrivial process that you'd have to do via the Live environment anyways.

Generally speaking, because you'd need to set up a system just to find the proper default permissions again, you'd be better off booting up to a LiveUSB / installer image, copying any data you want to keep off the drive as superuser in the Live environment to a second, external disk, and then blasting away the installed Ubuntu and reinstalling.

Thomas Ward
Thomas Ward
May 15, 2019 17:41 PM

Related Questions

Is it safe to chown `/usr/local`?

Updated September 13, 2017 17:02 PM

Change owner of files recursively, but not directories

Updated October 15, 2015 09:01 AM