0

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
Abhishek Rai
  • 115
  • 6
  • 1
    You could mount the volume on another instance and fix it, but you will have to fix a lot more. Usually it's best to start from scratch after such a mistake. Set up a new instance and restore your backups. – Gerald Schneider Feb 02 '22 at 07:53
  • @GeraldSchneider Basically, One should never find themselves in this situation. That is my takeway. The realistic solution is to simply create another instance since this was a lightsail AWS Cloud instance. Think deeply before using CHOWN . :) – Abhishek Rai Feb 02 '22 at 09:31

0 Answers0