New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Man accidentally 'deletes his entire company' with one line of bad code
MarkTurner
Member
Mr Masarla runs a web hosting company,
Last night I accidentally ran, on all servers, a Bash script with a rm -rf {foo}/{bar}
Thanked by 1netomx
Comments
is this suppose to be a joke ? cause i didn't laugh at it.
Ok, I managed to clone and empty repo into my working directory. Long day, tired eyes and 'terminal' a good mix they do not make.
Not as bad as the OP story but I will bet many on here have committed similar 'Oh f#@k' mistakes.
That's why backup is essential.
The man claimed to have backups on other mounted drives on the server but the command wiped his backups on the mounted drives
I don't think he had any offsite backups then.
yea, well rip that company :P
saw it on r/sysadmin (i swear it was there? cant check history as on dif comp) and jarland linked it on Cest Pit earlier
Yeah thats where I saw it first, and he then "supposedly" done a DD in the wrong direction. Not sure if to fully believe or not.
Yea i remember that.
some ppl thought about it being a troll, that it shouldnt have done it without --preserve-root (Or whatever the extra thing is, im no guru on that stuff) but i guess that dephens on the distro it was running on
I can't even imagine what the guy must be going through.
One thing I will never understand is why people keep backups mounted or connected all the time.
i hate how many people defend linux and act so ignorant.
You should not be able to delete core system files just by typing rm -rf /
It happened to me long time ago and i know many would suggest dont login as a root bla bla bla, but its just wrong. Root or not at least there should be a warning that you are about to delete the whole fucking system.
Ansible... f*ck up at scale
Anything rm -r related, if at all possible non-root... and certainly avoid variables if possible. I tend to stare at the screen for 10 seconds, check my sanity, palpitate for a little and then enter the command.
There are operating systems for people who need hand holding, and those operating systems are generally not designed for pretending to run a hosting company.
Show me a Linux server distro that doesn't give me the ability to make destructive mistakes, as defined by a third party, and I'll show you the trash can it belongs in.
Why were you entering rm -rf /?
you should atleast know what you are typing, and to google it if you dont.
i dont see new user randomly just typing that command on terminal with root tho
I'm just curious to know what's his company
rm -rf is a common command in day to day sysadmin - it just takes a slip of the hand, or a brainfart to do rm -rf /
I nuked a partition on a newly installed solaris server ~15 years ago by doing this, so luckily it just cost me time. In truth I shouldn't have been allowed next to near the machine as I had literally no idea what I was doing beyond CS 101 UNIX. I also "configured" a very expensive HP-UX server and got started on an AS/400 before my frugal boss realised the error of his ways and hired a real sysadmin,
Yeah, regardless of experience... everyone requires the intellectual honesty to appreciate that human error happens, a lot. Best we can do is by-design do things [already probably mentioned in relation to this example]
Linux is not only for those that are running a hosting company, i just use it for development.
If you are saying that it should be made as hard as possible so only a handful of people are allowed to use then i dont see any point here.
Maybe they should manufacture guns that shoot backwards by turning the safety switch on the other side as well, so that we can have the option to self destruct by mistake.
I was in the directory that i wanted to delete the files from, considering how other commands work i was expecting the same effect and passed in a / which was wrong, but that does not justify a whole system deletion, no matter how hard you defend it.
In fact if they say ok this can be better and we could implement some sort of safety trigger, then guys like you will defend that decision as well, because.. hey.. that's what have been decided.
Is it just me or does this sound completely made up and a "shits and giggles" question someone posted on SE?
That's the point. People who don't see the point need to point their bootloader to Windows or OSX. Linux is not "retarded-proof". And I object to your estimation that only "a handful of people" are not retards. That said, you can't
rm -rf
/
without a flag in modern distros.Just because one has a pulse, doesn't mean one is certified to access the root account on his machine.
It's not just you, probably a lot of folks, including myself, find this too unreal to be true... but honestly I wouldn't be extremely surprised if it were real either.
There's nothing to defend. The computer assumes you actually know wtf you ask it to do and happily obliges. You wouldn't want the computer to think it's smarter than its user, right? No need for them rising up.
I think so too. It's bullshit.
Umm no it doesn't. You're passing two flags to the rm command and a path. Two flags and a path from just accidentally dropping your phone on the keyboard? I think not. More likely "Trusted an internet troll and got burned."
I'm saying that I need my Linux to be for admins, not for kids. Make a distro for kids, but don't tell me it needs to be running on my server. If you need a server distro that doesn't let you run commands just because they can be destructive if accidental, as declared by a random third party (it's developer, not me...the admin), then I can't for the life of me understand what you're doing. Whatever it is, it isn't server administration. The distro developer does not know what my needs are, and I may need access to things that can be destructive if run by "accident" with multiple flags and a path.
You need to be able to run things without confirmation for scripting. No matter how complex those commands are made to avoid "accidents" some troll will still tell you to run the command on an internet forum and you'll still do it, resulting in the same problem. Changing the command every time it propagates across the internet and is used to troll someone is not a reasonable request for something used for production.
There are development environments that are not root accounts to Linux server distros. If development is what you need, and you're prone to "accidentally" passing two destructive flags and a path to the rm command, you really should be looking at one of those other products. Asking you to not use something you are not adequately prepared to use is much more reasonable than asking the world at large to change it's reliance on basic Linux functions every time someone on reddit says "lol run rm -rf /" and you do it.
If someone wants to make a backwards gun that's fine. But don't go buying it and complaining that it fires backwards. Obviously, whoever that was made for needs a gun that fires backwards and you bought the wrong product.
just stop man, you are full of non sense, you are deleting the system and there should be a safety trigger
tell me one drawback of having it and i will justify your ridiculous oppinion
There is! You used a flag that was designed to override it! You don't just accidentally fall into "rm -rf /" you ran it because someone told you to and you trusted them, when you clearly should not have.
Scripting without hackish workarounds.
which proves my point, it should not allow you to shoot your self in the foot/head. Very simple and logical.
Damn I got trolled lol. I thought you were serious.
On the other hand, what a good excuse to bail-out, if there ever was one...no?
Just because you don't have the hardware capability to understand a notion, does not equate said notion to nonsense. That said, I understand that it is nonsensical to you specifically.
One? I'll give you more:
You are in no position to justify anything, you know that right?
bail out? im just happy to bail out from ignorant minds atm.
yeah i bet everyone needs a rm rf on the whole system once in a while