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 ?

rohith
  • 1,370
  • 8
    because it's your system and you can break it if you want to – Zanna Jul 01 '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 01 '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 01 '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 01 '16 at 16:00
  • Yeah ! Actually true :D – rohith Jul 01 '16 at 16:01
  • 2
    "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". –  Jul 01 '16 at 16:02
  • Nice story :D "But I never blamed the Hole Hawg; I blamed myself. " so linux users must be careful enough you say ! – rohith Jul 01 '16 at 16:12
  • @rohith Correct. Linux assumes you know exactly what you're doing. –  Jul 02 '16 at 08:04

1 Answers1

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?"

waltinator
  • 36,399