Why am I unable to run sudo commands on my EC2 Linux instance

0

Hello All, After downloading Maven Zip and unzip i tried to make PATH Variable environment for Maven by adding it in /etc/profile I have given the below commands:- Vi /etc/profile export Path=$Path:/opt/apache-maven-3.9.2/bin :wq exit After i tried to enter into root user by giving sudo su- command but i was not able to run that command its giving error -bash: sudo: command not found.

Please suggest.

Thanks,

Monica
preguntada hace 10 meses859 visualizaciones
1 Respuesta
2
Respuesta aceptada

Hi,

Sometime it doesn't find path to sudo ie. /usr/bin/sudo. Try running "/usr/bin/sudo su -", if it doesn't work and you don't find sudo file at /usr/bin/, then please install sudo as below:

apt install sudo

Then, add your user to the sudo group using:

usermod -aG sudo your_username

You should be able to use sudo now.

If the answer is helpful, please click "Accept Answer" and upvote it.

PS: One thing, which I noticed is, there was no space between "su" and "-" in your question, I believe, that's just typo.

profile pictureAWS
EXPERTO
respondido hace 10 meses
profile picture
EXPERTO
revisado hace 10 meses
profile picture
EXPERTO
revisado hace 10 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