-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!

1 Answers1

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.