-3

I made a big mistake by running:

sudo chmod -R 777 /

After that, a problem appeared, which is that sudo won't work anymore. When I run sudo in any command this error appears:

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

And when I searched for the problem I figured out that some permissions are messed up in the /usr/bin/sudo file but I can no longer become root so I can change the permissions!

marked as duplicate by steeldriver, edwinksl, waltinator, Eric Carvalho, Zanna Aug 8 '16 at 6:10

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.

1

Seems like re-installing Ubuntu is the easiest way to go from here.


What happened?

Let's look at the command, bit by bit:

sudo - executes with root permissions (allows for maximum destruction)
chmod - changes the permissions of files (harmless if used correctly)
-R - recursive, descend into directories (could cause trouble)
/ - when combined with -R and sudo, recursively change all the files on your system to global-read-write-execute (very bad)

As you can see, you've basically soft-bricked your system.
Many programs and files on your Linux system require permissions to keep them afloat.

How can I fix this?

Unless you're willing to spend a lot of your time manually fixing the permissions, re-installing Ubuntu is the way to go.

Backup your data with a live CD, then delete your Linux partitions.

When you install Ubuntu for the second time, create new partitions.

  • thanks man im now 100% sure that i screwed up my system but how to backup my files and package? – Karrar Hyder Al-mosawi Aug 8 '16 at 23:50
  • @KarrarHyderAl-mosawi Mount the partitions you would like to backup to, copy the files over, then unmount. – InitializeSahib Aug 9 '16 at 0:38

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