Score:0

/etc/sudoers is owned by uid 1000, should be 0

ae flag

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
in flag
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.
Abhishek Rai avatar
ae flag
@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 . :)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.