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.

preguntada hace un año6134 visualizaciones
2 Respuestas
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
EXPERTO
respondido hace un año
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
respondido hace 5 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas