I accidentally changed ownership of etc
folder in a lightsail bitnami AWS machine. Is there a way to get the ownership back to root
. The main problem seems to be that the root
account doesn't have a password, so the password I enter is for the user bitnami
. That doesn't work.
E.g Command
bitnami@ip-17x-xx-x-xx:/etc/sudoers.d$ pkexec chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
Authentication is needed to run `/usr/bin/chown' as the super user
Authenticating as: Debian (bitnami)
Password:
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
==== AUTHENTICATION FAILED ===
Error executing command as another user: Not authorized
This incident has been reported.
bitnami@ip-1xx-xx-x-xxx:/etc/sudoers.d$ sudo su
sudo: /etc/sudoers is owned by uid 1000, should be 0
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin