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.

已提问 1 年前6139 查看次数
2 回答
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
专家
已回答 1 年前
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
已回答 5 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则