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年前6085ビュー
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ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ