0

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

bfrguci
  • 654
  • 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 03 '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 03 '16 at 13:38
  • @ByteCommander looks like they broke systemwide permissions – Thomas Ward Mar 03 '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 03 '16 at 13:49
  • @Arronical the command i had written is chown -R username:usergroup /*. – Shrikant D Mar 03 '16 at 16:29
  • @Thomas: is there a way i can take the backup of my work before doing the reinstall. – Shrikant D Mar 03 '16 at 16:29
  • @ShrikantD boot to a live USB or CD, and as root copy off the data from the drive to an external USB. – Thomas Ward Mar 03 '16 at 17:05
  • @Arronical He can't repair it without super user and if he can't login or use sudo then he is still stuck – Thomas Ward Mar 03 '16 at 17:05
  • @ThomasW. I realised that afterwards, would it possibly be fixable from LiveCD/USB? – Arronical Mar 03 '16 at 17:11
  • @Arronical possibly, but it's a little difficult to fix, because we don't have a 'revert'. His best option is to go into the system via LiveCD/USB, use 'root' on that disk to get the data off of his Linux partition (to back up the data), and then reinstall. it's too problematic to try and revert the filesystem back to its previous state because we don't know what it was at that time. – Thomas Ward Mar 03 '16 at 21:40
  • And when going in as root via the LiveCD/LiveUSB to backup data, they'll need another USB disk or similar to store the backup data - the LiveUSB won't store it. – Thomas Ward Mar 03 '16 at 21:53

1 Answers1

0

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.

bfrguci
  • 654