4

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 the below error:

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

$ ls -l sudo gives:

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

/usr/local/bin$ ./sudo ---> I need this /usr/local/bin ./sudo isn't working -- it throws 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

I need to access my sudo command from the terminal from anywhere.

0

2 Answers 2

9

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.

0
4

I recently experienced this problem because I ran the following command

sudo chmod -R 777 /usr/*

Unfortunately /usr/bin/sudo is not owned by root and breaks as a result.

To fix the problem I booted into recovery mode which provides a scroll down menu with an option to drop down to a root shell.

From the root shell I ran the following commands:

# remount disks in read write mode
mount -o remount,rw /
mount --all

# return ownership
chown root:root /usr/bin/sudo

# fix permissions
chmod 4755 /usr/bin/sudo

reboot

This solved my problems once I logged back in as a user.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .