1

I have used command sudo setfacl -R -m u:ubuntu:rwx .. Unfortunately, by mistake on root directory, stopped it in a middle, but to late.

I hoped to revere it by using sudo setfacl -bR / however now I believe I lost sudo access.

ubuntu@oracle-free-vm: ~ $ sudo setfacl -bR /
sudo: /etc/sudo.conf is group writable
sudo: /etc/sudo.conf is group writable
sudo: error in /etc/sudo.conf, line 0 while loading plugin "sudoers_policy"
sudo: /usr/libexec/sudo/sudoers.so must be only be writable by owner
sudo: fatal error, unable to load plugins

This is a free instance on Oracle cloud, so I have no direct access to the system. I'm having trouble with su - as I can't seem to know the password for root account, it might be disabled.

Is there any way to reverse changes made by setfacl or get to root to run a fix command? Or have I just lost all work and need to do reinstall?

Peregrino69
  • 2,337
  • 1
  • 15
  • 22
Leszek J.
  • 11
  • 3

1 Answers1

0

If you have your system with a locked root account, you can boot on a portable distribution on a DVD or USB drive (search Live distribution) or in rescue mode with cloud VM. Then, access a root shell, mount your system partition, and fix there what you need. (Like your setfacl command, or change the root password with chroot /mnt passwd if your system partition is mounted on /mnt).

Frédéric Loyer
  • 2,543
  • 4
  • 12
  • Apologize, I just ruralized I forgot to point it out that it is an VM in Oracle Cloud so don't have direct access to it. – Leszek J. Apr 06 '23 at 11:01
  • I don’t know Oracle Cloud, but the cloud providers I know (OVH, Scaleway) allow you to reboot a server on a Live distribution (rescue mode). It would be surprising that Oracle Cloud has not such a solution. You should search rescue mode like https://support.oracle.com/knowledge/Oracle%20Linux%20and%20Virtualization/1602157_1.html the answer is updated to insert the rescue mode solution. – Frédéric Loyer Apr 06 '23 at 11:24
  • Frederic, you first answer sort of pointed me in right direction after all. I have detached drive from one VM and connected it as data drive to other working VM, reversed changes made by setfacl and attached it back to original VM. Thank You – Leszek J. Apr 07 '23 at 15:23