I have changed my ubuntu super password by recovery mode after that i can't run my sudo command in normal user

i have attempted to crack my previous password in Recovery mode i followed this link to crack my password

>>>$sudo ---In global mode throws me an below error

sudo: /usr/local/bin/sudo must be owned by uid 0 and have the setuid bit set

>>$ ls -l sudo --> permissions

-r-sr-xr-x 1 root root 136808 May 29 2017 sudo

/usr/local/bin$ ./sudo ---> i need this /usr/local/bin ./sudo not working also throw the below error sudo: ./sudo must be owned by uid 0 and have the setuid bit set

/usr/bin$ ./sudo --> working fine

usage: sudo -h | -K | -k | -V

My question is

I need to Access my sudo comand from the terminal from anywhere i need to run

Any help will be appreciated

  • 1
    Please edit your question add the full output of ls -l /usr/local/bin/sudo – Andy Dalton Jan 23 '18 at 15:53
  • i have updated above question with ls -l sudo outupt @AndyDalton – muthukumar Jan 23 '18 at 16:02
  • 1
    Can you add the output of which sudo as well – CyberJacob Jan 23 '18 at 16:04
  • 4
    Why do you even have a /usr/local/bin/sudo? – steeldriver Jan 23 '18 at 16:04
  • /usr/local/bin/sudo yes i have and that also throwing the set uid error – muthukumar Jan 23 '18 at 16:10

You shouldn’t have a /usr/local/bin/sudo, that’s what’s breaking things (not the password change). Move it out of the way:

/usr/bin/sudo mv /usr/local/bin/sudo{,2}

and then tell your shell about it:

hash -r

That will restore the sudo functionality you’re used to.

  • now it throws me an error -bash: /usr/local/bin/sudo: No such file or directory – muthukumar Jan 23 '18 at 16:13
  • 2
    Did you run hash -r? Do you have an alias set? – Stephen Kitt Jan 23 '18 at 16:14
  • 2
    What is your PATH? – DopeGhoti Jan 23 '18 at 16:16
  • yes i have run hash -r -- /usr/bin/sudo --> working properly with sudo command – muthukumar Jan 23 '18 at 16:16
  • what does which sudo show? – mik Jan 23 '18 at 22:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.