4 ms·
On my internship while at uni back in 2010, I was tinkering with the company SVN server. It was the only machine running Linux in the whole company, and I'd onl
by gargravarr 10y ago
On my internship while at uni back in 2010, I was tinkering with the company SVN server. It was the only machine running Linux in the whole company, and I'd only learned Linux the year before. If I recall correctly, I was trying to set up Trac. Back then, it wasn't in the repos so I was having to set it up from a tarball.
So, what do you know, I broke something in the source folder and the whole Trac install was unusable. I decided to nuke it and start again.
I'm sure you all know where this is going by now.
Back then, I had a habit of tryping ./* for anything in the current directory, rather than just * .
I forgot the .
Me being a total n00b and naive, I thought the permissions warnings I got were genuine (I didn't initially run the command as root) and that because I was chown'ing stuff to www-data... yep. sudo !!
And of course, even though --no-preserve-root was a thing even back then, that only works if the argument given to rm is '/'. Otherwise, bash resolves the wildcard and passes each one in.
It took about 5 seconds to kill my SSH session, just long enough for me to notice the missing . and go OHSHI-
Worse, the machine wasn't backed up. It had a reasonably concise wiki on the company in-house software. On the flipside, that meant the boss shared the blame with me because there was no backup. We were able to rescue the SVN repos, but the MySQL data tables were gone.
So I can totally relate to the poor Gitlab sysadmin who's probably suffering PTSD right now. For want of a single . I managed to trash a production machine too.
As one of my friends would later tell me, 'root is a state of mind'.