You are viewing a single thread.
View all comments
31 points

This is actually my own Oh Shit story.

Early days of being a sysadmin and making changes on a major Linux server that we have in production. Running routine commands and changing permissions on a few directories and I make a typo. “sudo chmod 777 /etc/” instead of typing the rest of the directory tree I accidentally hit return.

It only ran for a fraction of a second before I hit CTRL + C to stop it but by then the damage had been done. I spent hours mirroring and fixing permissions by hand using a duplicate physical server. As a precaution we moved all production services off this machine and it was a good thing too as when we rebooted the server a few weeks later, it never booted again.

For those that don’t know, chmod is used to set access permissions on files and folders, the 777 stands for “Read + Write + Execute” for the owner, group, and everyone else. The /etc directory contains many of the basic system configuration files for the entire operating system and many things have very strict permissions for security reasons. Without certain permissions in place those systems will refuse to load files or boot if not properly set.

permalink
report
reply
12 points

That is literally a nightmare scenario for me, holy shit

permalink
report
parent
reply
3 points

If you didn’t use the recursion flag this wouldn’t be to bad

permalink
report
parent
reply
7 points

in hindsight I should have just changed into the directory directly first then used chmod without needing the full path. Or run the flag that asks you to confirm each transaction or dry run. I’m a much smarter idiot nowadays.

permalink
report
parent
reply
1 point

would that mean it doesn’t affect anything other than top level files ?

permalink
report
parent
reply
1 point

Yea without the R flag it only does the file (and since folders are files in Unix…)

permalink
report
parent
reply

Asklemmy

!asklemmy@lemmy.ml

Create post

A loosely moderated place to ask open-ended questions

Search asklemmy 🔍

If your post meets the following criteria, it’s welcome here!

  1. Open-ended question
  2. Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
  3. Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
  4. Not ad nauseam inducing: please make sure it is a question that would be new to most members
  5. An actual topic of discussion

Looking for support?

Looking for a community?

Icon by @Double_A@discuss.tchncs.de

Community stats

  • 10K

    Monthly active users

  • 5.9K

    Posts

  • 319K

    Comments