0

I accidentally ran the command

sudo chown -R ubuntu:ubuntu .

while i was in the root directory. Now every single files user and group has changed to the Ubuntu user and group. And none of the commands sudo, pkexec are working because permissions of /etc/sudoers.d file is incorrect. IS there any way I can recover. I cant login as root using password since it was not configured.

Is there any way I can fix this? logging in as root is sufficient for me to change the permissions back, as chown command works only as root.

This matter is extremely urgent.

Thanks in advance.

1 Answers1

0

Either boot into single-user mode via grub, or boot from a liveCD or USB stick. Either of these should give you access to the filesystem so that you can change file ownership. (When booting from CD/USB, you will probably have to manually mount the filesystem.)

jeffas
  • 81
  • 7