I'm new to ubuntu and I wanted to install MongoDB in my system. For some reason it was not installing properly and I got the solution as I have to change the permission of directories so that I can create /data/db directory. I ran sudo chmod -R 775 /
and now the whole system is not performing like before. It is not connecting to the router, brightness is not working and many more. Can anyone tell me what had happened and solution to make it proper again?

- 70,465

- 21
-
You can try the last answer I posted in the duplicate or reinstall. – Panther Dec 30 '17 at 15:25
1 Answers
You have changed the permissions of every file in the filesystem. Among other things running chmod 755
on a file clears the setuid
flag (any executable with the setuid
flag set runs as the user that is the owner of the file), and as this is used by a few executables that are part of the system (such as sudo
, which is owned by root
and relies on being run as root
when any user runs it to be able to work), clearing this flag means that they won't work. Also, the /tmp
directory (for temporary files) has 777
permissions (anyone can write) so that anyone can put files there. Removing that permission will break things.
These are just a couple of things that you broke when running sudo chmod 775 /
. As for fixing this, the easiest solution will be a fresh install of Ubuntu. System files have the permissions they have for a reason, and changing them can break things and introduce security risks. If you have anything you want to keep and can still use the file manager, copy them to an external drive. If not, boot from the Ubuntu Live Installer CD/USB and use that to copy your files off. Then check that your files actually are on the external drive and intact and if so then reinstall Ubuntu on the computer. And in future, don't make recursive changes to file permissions like that and remember that sudo
lets you easily wreck your system if you don't know what you're doing.

- 51