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
demandé il y a 10 mois859 vues
1 réponse
2
Réponse acceptée

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
EXPERT
répondu il y a 10 mois
profile picture
EXPERT
vérifié il y a 10 mois
profile picture
EXPERT
vérifié il y a 10 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions