I read here that chmod -R 777 / is a really bad idea, because it overwrites permissions on files, and erases sticky bits and setgid and stuff.However I was thinking that chmod -R ugo+rwx / would not overwrite the permissions but add them, if not there already present, and that it would be therefore much safer than the aforementioned command.Am I right? Or are those commands basically the same and both would destroy my system?I don't intend on doing it, just asking for general culture.
Is `chmod -R ugo+rwx /` safer than `chmod -R 777 /`?
permissions;chmod
You would strip all security from your system making it extremely vulnerable. Lots of programs would stop functioning due to insecure permissions. You are technically right it would append those rather than over write so you would keep SGID and SUID permissions. I have an old Ubuntu machine I no longer need so I figured I would test this. After running chmod -R ugo+rwx / sudo stopped working due to insecure perms on /usr/lib/sudo/sudoers.so . ssh stopped working because I was using rsa keys which also required strict permissions. I couldn't reboot the machine in the OS because sudo was broken however the power button worked just fine. I was surprised because the server actually booted up just fine, I could probably fix it with single user mode but I am just going to reinstall. So to answer your question, no. While chmod -R ugo+rwx / is technically different than chmod -R 777 / it is not safer because they both break your system.