I’m working on a some materials for a class wherein I’ll be teaching some young, wide-eyed Windows nerds about Linux and we’re including a section we’re calling “foot guns”. Basically it’s ways you might shoot yourself in the foot while meddling with your newfound Linux powers.
I’ve got the usual forgetting the .
in lines like this:
$ rm -rf ./bin
As well as a bunch of other fun stories like that one time I mounted my Linux home folder into my Windows machine, forgot I did that, then deleted a parent folder.
You know, the war stories.
Tell me yours. I wanna share your mistakes so that they can learn from them.
Fun (?) side note: somehow, my entire ${HOME}/projects
folder has been deleted like… just now, and I have no idea how it happened. I may have a terrible new story to add if I figure it out.
I once removed all groups from my user by using
usermod -g
instead ofusermod -G
I did the same! After that, I never tried to run that command from memory
You probably mean that you used
usermod -G
instead ofusermod -a -G
The -a stands for append
But you understand what I mean.
Reformatted windows and installed Linux.
Wait before the hate. This was the first time I did it and knew nothing about it and didn’t know it would wipe my system. So I lost everything.
On the brighter side, you did delete windows.
Yeah I don’t see the problem here
rm *.c
when I meantrm *.o
Not me, and not Linux, but a school mate found the following bash snippet online
:(){ :|:& };:
.Naturally, he tried it on the SunOS servers we had access to for schoolwork. He got his account suspended for the rest of the year.
I think most Linux distros are configured to kill fork bombs nowadays.
My biggest thing when switching to Linux was understanding why I didn’t have permission to alter half of my file structure. I was trying to take ownership of my /usr directory as a user and had to have multiple people explain why that was a bad idea (and why simply making any changes as a super user via terminal was more than adequate for the results I wanted).
My mindset was a result of so many user files being spread across dozens of branches of the Windows file structure. Some very close to the root of the drive, some a few directories deeper. I didn’t really understand the benefit of having all my stuff in /home (and am now a full convert. Just thinking about navigating a Windows drive makes my skin crawl now).
That’s one damn fine username you got there!!
Gotta say, yours ain’t bad either my friend
“I have 200 GB of unused space in the windows partition, I’ll just plug a live CD, divide that partition and merge it with the Linux one, ggez”
Yes, dividing the windows partition destroyed it. Yes, mixing the windows and ext destroyed Linux. I might have been able to recover something but I was like 18 and I just reinstalled windows in a fit of misdirected anger against Linux.
I’m still stuck in vi
dd if=/dev/zero of=/dev/sda status=progress
hmm why is it so fast
OH
CTRL-C
and then a kernel panic yeah my fs was gone
I do dumb things like edit my network configuration do some stuff and log out. Then I can’t login the next weekend because the IP address is wrong. Also:
Ifconfig eth0 down
And I am booted from ssh.
Yeah screwing with the network interface of the machine you’re SSHd into is something nearly every sysadmin have done at least once.
That or changing something, rebooting the server and subsequently being unable to contact it again due to said change. I’m always scared and feeling I’m taking a risk when upgrading a major OS version over SSH, yet Ubuntu never failed me in that, it’s the silly things that got me, like messing with fstab.
Due to some poorly placed quotes, I managed to create a subdirectory named
~
in my home folder. You can imagine what happened next. Luckily, I had just gotten my backup system up and running the day before, so nothing was lost.i accidentally mark iwd as dependency rather than explicit. after that someday im removing a package depends on iwd, iwd itself been removed as a dependency as well. and im been blocked out of my remote machine until someday i have physical acces to it
How I lost a Postgres database:
- Installed Postgres container without configuring a volume
- Made a mental note that I need to configure a volume
- After a few days of usage, restarted the container to configure the volume
- …
- Acceptance
Well, that’s a dumb Docker thing, not necessarily a dumb Linux mistake. You could’ve made the same mistake on Windows or MacOS when running Docker.
Technically, containers always run in Linux. (Even on windows/OS X; on those platforms docker runs a lightweight Linux VM that then runs your containers.)
And I wasn’t even using Docker.
apt
something that ended up removingsudo
. No more admin rights.- used
rsync
to backup pretty much everything in / , with remove source option… find
with-delete
option miss positioned. It deleted stuff before finding matching patternchown
/chmod
on/bin
and/or/usr/bin
- Removed everything in
/etc
The first one can be fixed by using
su
Not if root account is disabled. Which is by default on Ubuntu and Debian . You’d need
sudo su -
but well… No sudo left you know.Damn
Using sudo when it isn’t necessary, and the real cannon: sudo su… Adding sudo to your command lines indiscriminately causes files you create to be owned by root even though they are in your home directory, and then you end up using sudo to make changes to the files… and then the filesystem permissions cannot prevent you from successfully running an accidental “sudo rm -rf /” command.
Seriously… sudo is not a “habit” to develop in order to avoid dealing with filesystem permissions problems.
This is an actually good thing to teach Linux users. The spamming of sudo in Linux terminals has been a disaster for mankind.
I updated a manjaro system.
Did you… Kill-a-manjaro?