-1

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?

vottakvot
  • 101
  • 4
    Did you run this command as sudo or as the root user? 'Cause otherwise it wouldn't have done much. If you did run it as sudo or as root, you're hosed, and attempting to "revert" this is going to be TONS of pain, you'd be better off reinstalling after mounting to a LiveUSB/installer image, and copying off any data you want to keep to a second flashdrive then reinstall the system clean. – Thomas Ward May 15 '19 at 17:36

2 Answers2

1

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

Gordster
  • 1,719
  • 1
    ... which is a lesson in futility because you'd need to have the 'original' permissions schema which only a 'clean' install would have. – Thomas Ward May 15 '19 at 17:42
1

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
  • 74,764