5

Trying to install tor-browser, I screwed up my sudo privileges when I tried to take ownership of a directory. Now I get a message:

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

every time I want to use sudo.

Running Mint 17.

  • 4
    It's not your sudo privilege. Depending on the command you ran, you broke part or all of the ownership/permissions of your system files. What command did you run ? – Leiaz Mar 2 '15 at 12:07
  • Of course, you are correct - my terminology sucks. I wanted to run the command:sudo chown $USER -Rv /usr/bin/tor-browser/, but instead I typed: sudo chown $USER -Rv /usr/bin/ tor-browser/ - and then the ownership/permission went out the door... – Merciless Mar 2 '15 at 12:29
  • 1
    First, a directory owned by your regular user in /usr/bin is a really weird idea... For the current problem, the files in /usr/bin should be owned by root, but a dozen or so have also lost their setuid bit like sudo. The simplest would be to use the package manager. I'm finding apt-get --reinstall install but there may be something more fine-grained ... – Leiaz Mar 2 '15 at 14:06
9

First restart the pc, press SHIFT key while Ubuntu is booting.

This will bring you up the boot menu.

Go to Advanced Options.

Select your OS version in (recovery mode), and press Enter Key.

example : Ubuntu 14.04 (recovery mode)

It will bring you up another screen. Now select “Drop to root shell prompt” and press Enter.

It will load a command line at the bottom of the screen.

Now run each of the following commands.

# mount -o remount,rw /
# mount -a
# chown root:root /usr/bin/sudo
# chmod 4755 /usr/bin/sudo
# init 6

This will fix your sudo Above error.

  • 4
    This will only fix sudo. If the OP was trying to change permission of a directory, there is certainly more to fix. – Leiaz Mar 2 '15 at 12:18
  • Thank you very much - it worked like a charm. There was a time that I was fluent in DOS, up to V 6, as a matter of fact, but the Win GUI made me lazy. This is a new challenge... Thanks for the prompt help. – Merciless Mar 2 '15 at 12:33
  • That is a marvelous answer. It saved a lifetime for me. after all struggling and wrong answers I found on internet, This actually solved the issue – Farzad YZ Nov 26 '15 at 8:26
  • Please do not do this, this will only partially fix the issue. You may have surprises in the future. – obo Apr 19 '17 at 9:09
  • Then you provide the correct solution – Babin Lonston Apr 19 '17 at 18:10

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.