I am fairly new to Ubuntu. I am currently using Ubuntu 14.04 version. I am stuck into a problem that my primary user account is not functioning after i ran a command chown -R username:usergroup /* on a secondary user.

I have two users in my machine. Both are administrator functionality. One name is abc and other is root. abc is the primary user and i had run the command by the other user. Thereafter i am having this problem.

  1. I can't able to login with the second user.
  2. Guest account is working fine but the other account is not.
  3. Sudo command is not working.
  4. Primary user UI is very slow and keep blinking every time.
  5. Shut down option not working.

Getting error message as "sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set" after running the sudo command

marked as duplicate by psusi, David Foerster, Pilot6, Sergiy Kolodyazhnyy, Eric Carvalho Mar 4 '16 at 12:19

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Please add the output of ls -l / /usr/bin/sudo to your question (edit it!) and also add the exact error message you get when trying to use the sudo command. – Byte Commander Mar 3 '16 at 13:24
  • FYI: you should never change ownership of things in / (the root of the drive) - you break things like sudo and system utilities. Time to reinstall your system. – Thomas Ward Mar 3 '16 at 13:38
  • @ByteCommander looks like they broke systemwide permissions – Thomas Ward Mar 3 '16 at 13:38
  • It should just be the top level directories in / that were affected as there was no -R option set on the chmod command. – Arronical Mar 3 '16 at 13:49
  • @Arronical the command i had written is chown -R username:usergroup /*. – Shrikant D Mar 3 '16 at 16:29

chown changed the ownership, and -R did it recursively on /*.

You have changed the owner and group of all files in your root file system. Since there is not a way to get this operation reverted as is discussed here: What if I accidentally run command "chmod -R" on system directories (/, /etc, ...), you may have to backup your files and reinstall. That's why sudo warns you that you should use root privilege with care.

Well, you can definitely fix the ownership of sudo by using a Live CD/USB, but I would expect there be many other problems from other applications. Not all files in the root file system are root:root.

  • I had taken backup of my ubuntu by using a boot able pan drive and then reinstall the ubuntu. – Shrikant D May 16 '16 at 10:46

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