872

My Friend: Dude our Linux Server is not working anymore!

Me: What? What did you do?

My friend: Nothing I swear!

Me: But you were last on it?

My friend: Yes. I just wanted to run a bash file and needed to give it permissions.

Me : WHAT DID YOU ENTER???!

My Friend: Chill man, just this command I found on the internet
chmod -R 600 /
chown -R root:root /

Me: WHY ARE YOU EVEN IN ROOT AND GOD DAMMIT WHY ARE YOU EVEN USING SOME RANDOM COMMAND FROM THE INTERNET. YOU KNOW YOU SHOULD NOT DO THIS OR JUST ASK!

My friend: Ok I did something wrong, how can I fix it?

Me: Did you make a backup or rsync of the server?

My friend: No. I just wanted to run this file.

Me: You holocausted the server. FUCK MY LIFE

Comments
  • 44
    Like every 2-nd day at work.
  • 37
    That's why I'm the only one that accesses the servers 😱
  • 4
    How was he even able to do that?
  • 17
    Push the server to github? 😂
  • 43
    @Charmgoggles I gave him the root account for emergency's when I cant access the servers and need on too.

    I told him then, that this is just for the worst possible situation and I would call him and tell him what to do or not.

    Haha guess what? Reads online root acces needed and straight logs in without asking :P
  • 7
    @MoboTheHobo I am not well versed with linux but I know what chmod, chown are for but I wanted to know what exactly those commands did? Why server became unusable?
  • 3
    @KnightsOfCode Thank you for your concern. I'm not in any troble, was just a small private server with teamspeak and Mailserver. Had a older Backup lying around ;)
  • 9
    @darkShadow07 He granted root permission to some script downloaded from the internet. I assume the script was malicious from the tone, and when you run a malicious script with root permissions, it's basically game over for your server, you need to reinstall everything from scratch (even if you find a virus, you cannot be sure you found ALL virus)
  • 16
    @darkShadow07 the / at the end gives the command to use it for the whole server. Here the explanation: https://cyberciti.biz/faq/...

    1. Whole Server Files were 600 and for all owner/group was root.

    2. Permissions system breakdown. No service works anymore like apache user. You can't really repair it without a backup, or you would need to check every little file. Thats almost impossible.

    3. When you would give chmod 755 for all again to work, you kernel would refuse it and also your system would be insecure, everybody could read files and use holes.
  • 3
    Damn, what an idiot... Do you have your server running locally? If you can boot a Live CD you can chmod back some data, but if you have a remote server, well, IDK how to restore that)
  • 8
    @OrestH It's fine again, everything running good and the backup was ok.

    My Hoster has a rescue system where you can upload you old backups and it mounts them on the machine.
  • 1
    @MoboTheHobo Thanks for making me understand, I am glad that you had an old backup
  • 31
    Before trying random commands and scripts found on the internet, one should always make the "Is the internet safe"-test.

    It's easy to do. Just mix some drugs from random recipes found online. The ingredients can probably be found in random web shops. Now, try the drugs. If you don't get irreparably and possibly fatally poisoned, then the internet is a safe place were everyone is honest and benevolent. If not, collect the Darwin awards.
  • 1
    What does these commands do btw.
  • 10
    My sides are in orbit! Holocausted! The one time this word actually is properly used in a non offensive but verbally fierce way! Have lots of upvotes!
  • 3
    @anup-dhabarde

    Chown is for setting Owner and Group of files. (User who can run it)

    Chmod is giving or removing permission to run it on different user levels or even just run it. You can set here read, write, execute permissions.

    I already answered the same question above for darkShadow07. Just scroll a bit up ;)
  • 1
    @MoboTheHobo you're lucky one)
  • 2
    I have done this before. I learned it the hard way how little knowledge can be very dangerous.
  • 4
    Had me at "holocausted the server" :D
  • 4
    Glad you didn't Gitlab the backups! 😁
  • 5
    Your friend clearly is unworthy of the mighty root powers. He should be banished from all systems and forced to use Windows ME.
  • 2
    Just like our colleague, except that he mounted root fs over nfs. And guess what happened...
  • 16
    I love those "new verbs":
    # Gitlab backups
    # holocaust projects
    # volkswagen unit tests (basically pretending that all checks are good by just returning true instead of actually checking stuff) ^^
  • 2
    Lol thanks guys for 500++. Didnt think that my rant would get this much attention 😂.

    Well, next time I can use the stress ball in need 😉
  • 1
    and this is why i never give my friends root
  • 1
    @skords it's good to learn it on your own system though . I destroyed my Ubuntu few times but I also found the way how to bring back my files. Then if you come to prod you have amazing respect before trying something ...
  • 1
    Such a small rant causes so many hands on the head!
  • 2
    @darkShadow07 chmod 600 /file gives the files owner read+write permissions (no execute) for only the file owner while not allowing any other users to access that file. chmod 600 -R / applies these permissions on every file on the server. If that command was successful I highly doubt he would be able to run the second command because there would be no execute permissions on /sbin/chown. However chown root -R / changes the owner of every file on the server to root
  • 0
    Really? I'd rant about you not being smart to have automatic provisioning and backups. 🙃
  • 1
    @galileopy I posted above, that I played back in a backup.

    But over 250 Player Inventory in Minecraft were reset trough that and the Server crashed ;)
  • 0
    Not familiar with the effects of that, anyone explain?
  • 0
    this is what most of my customers did when I worked at one big linux vendor in the support department, but they weren't that polite, they only said DO THE NEEDFUL. I did 4 years there, my mind is screwed forever.
  • 2
    @Ranchonyx He removed his own 'execute' permission on all files. He locked himself out and he can't do anything on the server now. He can't repair the situation since he can't execute anything.
Add Comment