0

I did sudo chmod -R 777 / on our production server and everything got messed up. The hosted sites and API's stopped working, SSH said connection refused, it was a cyberpanel running cent os 7 and we couldn't even log into cyberpanel.

I thought that all users would have have all permissions on all files in the system and executed the command. I don't quite understand what went wrong.

  • 1
    HI @OroZoro. Go for the backup or last snapshot. Too much work to recover it and related security issues. – jpbrain Jun 29 '21 at 16:12
  • Welcome to Ask Ubuntu. CentOS 7 is not an official flavor of Ubuntu. – user68186 Jun 29 '21 at 16:13
  • 5
    The question you probably should be asking is: WHY did you run sudo chmod -R 777 / on a production server? – Artur Meinild Jun 29 '21 at 16:18
  • sudo chmod 777 -R / makes every file and directory on the entire system world-readable, world-writable, and world-executable. And since 777 is equivalent to 0777, it will also deactivate the setuid, setgid, and sticky bits. Your system is now completely de-immunised. Wipe and reinstall everything from scratch. – 000 Feb 23 '24 at 00:06

1 Answers1

1

You just messed up your system; time to reinstall.

Yes, theoretically you now have all permissions, but you lost all setuid, setgid and sticky bits. Apart from losing all security, of course. Doing that on a production server (!!) is the cherry on top.

You lost the ability to use sudo, su and probably a dozen other commands that you probably wanted to keep using.

HuHa
  • 3,385
  • I thought theoretically and acted, there wasn't any backup maintained, we had to reconfigure everything, to my fortune, there weren't any logs maintained so the culprit is unidentified :). Thanks for your answer. – OroZoro Jun 30 '21 at 05:41