I get this error trying to run sudo command sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set

0

I get this error trying to run sudo command "sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set" In all our instances, yesterday evening there was no issues, but this morning I noticed that the apps are not working anymore. when I connected to my instances, i got the error when i try to run any command with sudo.

Please if someone had the same issue or have any idea why this happened, thanks in advance.

asked a year ago5942 views
2 Answers
0

You may have changed the permissions on "/usr/bin/sudo".
To correct the problem, access the site as the root user and execute the following command.
However, a password must be set for the root user in advance.
If it is not set up, this method cannot be used.

su
chown root:root /usr/bin/sudo
chmod 4755 /usr/bin/sudo

For other methods, please refer to the following documents.
https://repost.aws/knowledge-center/ec2-sudo-commands

profile picture
EXPERT
answered a year ago
0

I couldn't be a root user by using the "su" command because I didn't have a root password, but instead I used this command to become a root user: systemd-run --shell and after that: chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo My problem is solved.

profile picture
answered 4 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions