I have done this:

sudo chown -R myname /usr/

and now I can't use the sudo command because of this error:

sudo: must be setuid root

And as I read this means that the owner of this file /usr/bin/sudo is not the root. It's my user now because of the chown on the /usr folder.

On many forums and blogs people suggest to do this as root:

# chown root:root /usr/bin/sudo
# chmod 4111 /usr/bin/sudo

...but the problem with this is that I need to log in as a root, but I can't because If I write su in the terminal the password is wrong (actually I use the password what I added to my user):

$ su
su: Authentication failure

So can I get back the sudo command?

Edit: My Ubuntu is under Paralells on my Mac OS X.

  • What do you mean by "I use the password what I added to my user"? When you use su, you will be prompted for root's password, not your user's password like with sudo. Do you know the root password for this machine?
    – Caleb
    Jul 19, 2011 at 13:36
  • No, I never needed to add or modify it, is there a default for it? Jul 19, 2011 at 13:37
  • You need to reboot in single user mode. What distribution are you running? Jul 19, 2011 at 13:40
  • 1
    Just curious, but what made you decide to run a sudo chmod -R cirk:cirk /usr What were you trying to accomplish? Jul 19, 2011 at 15:00
  • 1
    A Program what was installed somewhere in /usr/ since I didn't known the exact location of the program I decided to use chown on the entire usr folder, and because I'm a noob I screwed up everything again :P Jul 19, 2011 at 15:09

6 Answers 6


Since you have hosed the permissions on the only thing that gives you root level access, you will need some help from OUTSIDE the current software environment to fix this.

I suggest that the easiest way is to boot up a LiveCD for your distro, mount your drive, and change the file permissions using the chmod you listed from there.

You could also try booting into single-user mode in order to get a root shell.

Be aware that usually all things in the /usr/ directory should be owned root so you should just be able to do a recursive chown to fix whatever you broke. (Edit: Per @Gilles comments apparently running chown breaks setuid and setgid bits, so you will need to manually compare to an existing system to restore all of those once you fix the ownership again.)

However, very FEW should be 4111. That extra one is a special permissions but that makes it execute as root even when run as a user! Only sudo and a select few commands should have this permission bit set. If you didn't run a chmod to start with you probably don't need to fix this at all, all the permissions should already be correct. Don't run a big chmod operation without knowing what all the permissions are supposed to be.

  • Is it possible if the OS is in a Virtual Machine? Jul 19, 2011 at 13:53
  • Yes that makes no difference. You could use runlevel 1 (something you can do at the very beginning of the boot process from grub/lilo or wahtever your bootloader is) or you can setup the VM to use an ISO image of the LiveCD as the boot device.
    – Caleb
    Jul 19, 2011 at 13:57
  • aham, well before I reinstall it, I will try your advice :) Jul 19, 2011 at 13:58
  • ok I think I'm in the LiveCD, now I need to write this in the terminal? sudo chown -R root /usr/ ? Jul 19, 2011 at 14:35
  • Ya start with that, but not on /usr on the LivdCD, you need to mount it somewhere and run against that path, say /mnt/mydrive/usr. Then you will need to fix the setuid bit on /mnt/mydrive/usr/bin/sudo. Then look through the /usr on the livecd and see if there are any other ownerships other than root. find /usr -not -uid 0 and change those to match. Then look for things that have different setuid or setgid bits set and make sure those match too. If you have a real Ubunutu system to compare to that would be best.
    – Caleb
    Jul 19, 2011 at 14:39

If you have a similar system that you can use as a guide to see what the correct ownership for all of the files is, then you can boot into rescue mode, drop to a root shell, and manually restore the correct ownership to all of the files in /usr.

The quickest way may be to reinstall your OS or restore from backup.

In Ubuntu or similar, then there is no root password by default (the account is disabled), which is why you can't su.

  • 8
    Woah take it easy there, this isn't windows re-installing is not always the easiest or fastest way to do anything and certainly doesn't teach people how to fix problems. In this case all he needs to do is reverse the action he took which can easily be done by mounting the file system up in another environment like a LiveCD or the rescue mode you suggested (distro dependent).
    – Caleb
    Jul 19, 2011 at 13:43
  • @Caleb when you completely trash the permissions on an major chunk of the filesystem it is. He didn't just screw up sudo, presumably he forgot to mention in his post that he used -R ( otherwise it would have only changed the owner of the /usr directory itself and not sudo ). I also did describe how to reverse the process, but it is a very time consuming and painstaking task.
    – psusi
    Jul 19, 2011 at 13:50
  • 1
    This is a case of chown not chmod. Since everything in the /usr folder should be root:root, this should be an easy fix, not the painstaking fix that a chmod clobber would mean.
    – Caleb
    Jul 19, 2011 at 13:53
  • 2
    @Caleb not everything in /usr should be root:root.
    – psusi
    Jul 19, 2011 at 13:56
  • 6
    @Caleb chown resets the setxid bits. There are a few files in /usr that aren't owned by the root; more that are in a different group (especially setgid programs in /usr/bin). Jul 19, 2011 at 14:12

In Ubuntu recovery mode, enter the following commands..This fixed the isssue for me..

mount -o remount,rw /
mount --all
chown root:root /usr/bin/sudo
chmod 4755 /usr/bin/sudo

Hope this will fix your problem.( or somebody else's)

I found this one here in this blog post.


This is much easier than suggested by other answers. No need to format, reboot or use live CD.

su root # then enter your password to switch to root user
chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo
exit # to get back to the original user

This is the easiest way to fix this issue. Explanation, sudo is corrupted (I know corrupted is the wrong term, but it is not working, so, we need to avoid using sudo)

  • Using command 1 (su root) , we change user to root without using sudo.
  • Using command 2 (chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo) , we fix the permissions / ownership of sudo.
  • Using command 3 (exit) , we get back to the original user.

I have tested this method on Linux mint. Which is a ubuntu like system. Let me know this this method does not work on any other OS. Will update the answer accordingly.


  • as I understand, by default root account does not have password, so it is impossible to provide password at the first step su root, and because sudo does not work, it is impossible to set root password Sep 26, 2017 at 11:04

This is simpler than people are making it. Try the following:

  1. Instead of trying to log in as root using the broken su command, log out as your current user and log in again as root via your normal Display Manager (i.e. login screen).
  2. Execute following at the terminal: chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo

This should fix the sudo command and have you up and running again in no time.


To login as root, without su or sudo, you can use pkexec:

pkexec su

Now change the files’ permissions:

chmod 440 /etc/sudoers
chmod 775 /etc/sudoers.d
chmod 440 /etc/sudoers.d/README

You must log in to answer this question.

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