Linux – Fixing Error sudo: /usr/bin/sudo must be owned by uid.

Linux – Fixing Error sudo: /usr/bin/sudo must be owned by uid.Here is another interesting thing I came through very recently.  If you have ever used a unix based operating system like Ubuntu, I bet you have had run into problems which happens suddenly, and you have no idea what caused it :)

This is the error I got,

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

Now I’m going to tell you how I got the above error and how I fixed it.

I searched in many forums about this, and I found that there are two reasons for getting this error.

01.     Directory “/usr/bin/sudo“  is not having permission 755.     This happens if you run a command like “sudo chmod –R 777 /usr/” - which will set the permission to 777 for all the directories recursively.

02.    Directory “/usr/bin/sudo“  is not owned by the root user. (In case if you have run a command to change the owner.)

My issue was due to reason 01, and I solved it by following the below steps.

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

This will bring you up the boot menu.

Select Advanced Options.

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

Ex : 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 --all

chown root:root /usr/bin/sudo

chmod 4755 /usr/bin/sudo

restart

Now your pc will restart. Once you log in, you will find that you can use the sudo command again :)

Please leave a comment if this worked for you.

31 comments :

  1. Replies
    1. I'm glad to hear that S@C|-|!/\/. Thanks for the feedback! appreciate it.

      Delete
  2. Is this the same error you are getting? If you follow the above steps correctly, it should solve the issue. But if not, maybe the issue you have is different. Please let me know after you tried it again..thank you for taking time to leave feedback.

    ReplyDelete
  3. It works. Very Good.

    ReplyDelete
    Replies
    1. Thanks for the feedback Anonymous...I'm glad it worked for you..

      Delete
  4. Replies
    1. Hi Rio Oktafianto, Thank you very much for the feedback. I'm glad it helped :)

      Delete
  5. hy guys,

    it didn't work fo me,

    i only change chmod 777 directory /usr/bin/ , then i follow the above steps. untill restart, but still didn't work.

    Any suggestion for me?

    ReplyDelete
  6. Hi,
    Thanks, worked fine for me.

    ReplyDelete
    Replies
    1. You are welcome..Thanks for the feedback :)

      Delete
  7. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. I removed this comment as I was doing one silly mistake while following your steps.

      Delete
  8. Thank you.. It was helpfull.. :)

    ReplyDelete
  9. mine never worked.instead of the pc restarting it brings an error that it failed to disable graphics turbo

    ReplyDelete
    Replies
    1. Hi Herman Musungu, are you sure that this is the same error you've been getting? and have you followed the given codes as it is? It has worked for many. Please see the above comments. I cannot guarantee it to work, but it's really sad to hear that it didn't work for you.

      Delete
  10. I was lost 3 hour to find problem this. Thank you so much.

    ReplyDelete
  11. Worked great. For some reason had to follow ALL the instructions though. Go figure :-)

    ReplyDelete
  12. It really works! Thumbs Up!! I have fixed this issue on my computer and of my friend's too.. by following your steps and it worked like a charm!
    Thanks a lot, one important thing:
    If anyone can't go to the Recovery mode easily just Turn off your computer and then Start it again.
    After getting BIOS loaded (just before the ubuntu logo) press SHIFT Key and then Select "Advance option" then "Recovery Mode" ...

    ReplyDelete
  13. thank you very much buddy it worked for me on Ubuntu 15.10

    ReplyDelete
  14. It's work for me but when I log-in to ubuntu about 1minute it back to login page. I don't know why.

    ReplyDelete
  15. Thank you so much buddy.... it worked for me on Ubuntu 16.04

    ReplyDelete
  16. thank so much, buddy. You save my day.

    ReplyDelete