5

After going through this question I'm quite scared!

It's not that I don't want to use sudo rm command, but I want to inhibit the execution of the sudo rm -rf --no-preserve-root / command. If this command can ruin a motherboard, Why does it even exist ? or Why should it even exist ?

  • 7
    because it's your system and you can break it if you want to – Zanna Jul 1 '16 at 14:54
  • 6
    Linux does not usually limit what an administrator can do; hiding and disabling features from power users because they might be destructive in the wrong hands is not the Linux way. Even Windows allows you to delete system directories or format the hard drive if that's what you really wan to do! If it's any reassurance, you cannot run that command without being prompted for your password; this gives you a chance to make sure it's what you want to run. – Nick Weinberg Jul 1 '16 at 14:56
  • 9
    The command itself does not brick your computer, it simply deletes all files in the file system tree. The problem is not this command, but that parts of the EFI system are mounted writeable by systemd and that some EFI implementations are not following the standard and can not handle this. – Byte Commander Jul 1 '16 at 14:56
  • 8
    Why be so scared of it? It needs the --no-preserve-root option, which you can't just type in by accident, and it needs your password, so someone else can't just walk up to your computer and type it. It might seem scary, but you can just as easily throw your computer off the balcony of a third-story apartment if you want to. If you don't want to, just don't throw it off the balcony; problem solved. – insert_name_here Jul 1 '16 at 16:00
  • 1
    "Why does it even exist" Because Linux does not offer many idiot-proof guards — this is a strength — if I want to change something big, Windows or OS X is like "No no no you don't want that" but Linux is "OK, If you say so." It lets me choose how I run my system. It does what I tell it to do. I recommend reading Chapter 12 of "In the beginning there was the command line". – UniversallyUniqueID Jul 1 '16 at 16:02
10

Welcome to Security Whack-A-Mole, the game where you try to enumerate ALL the ways you can get hurt, and try to wrap each one in bubble wrap. You can never win.

Rather, learn to use Unix/Linux tools, understand what your system does, and don't run scripts (or anything) you don't understand (that comes from an untrusted-for-system-upgrades source).

Your question is equivalent to "I can shoot myself in the foot, thusly. Why don't guns not automatically deflect their aim away from me?"

  • lol, that joke made more sense than many explanations i read so far – InAFlash Sep 24 at 13:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.