Anyone who has never made a mistake has never tried anything new. — Albert Einstein.
Here are a few mistakes that I made while working at UNIX prompt. Some mistakes caused me a good amount of downtime. Most of these mistakes are from my early days as a UNIX sysadmin. This page lists my top ten Linux or Unix command line mistakes.
A list of my 10 UNIX command line mistakeshttps://pix.cobrasoft.org/images/2023/01/06/my-10-unix-linux-sysadmin-mistakes.001-1.jpg
They say, "Failure is the key to success; each mistake teaches us something." I hope you will learn something from my 10 Linux or Unix command line mistakes as well as the comments posted below by my readers.
userdel CommandThe file
Quote/etc/deluser.conf
was configured to remove the home directory (it was done by previous sysadmin and it was my first day at work) and mail spool of the user to be removed. I just wanted to remove the user account and I end up deleting everything (note -r was activated via the deluser.conf):
Quote#userdel foo
Rebooted Solaris BoxOn Linux killall command kill processes by name (killall httpd). On Solaris it kill all active processes. As root I killed all process, this was our main Oracle db box:
Quote#killall process-name
Destroyed named.confI wanted to append a new zone to /var/named/chroot/etc/named.conf file., but end up running:
Quote./mkzone example.com > /var/named/chroot/etc/named.conf
Destroyed Working Backups with Tar and Rsync (personal backups)I had only one backup copy of my QT project and I just wanted to get a directory called functions. I end up deleting entire backup (note -c switch instead of -x):
Quote#cd /mnt/bacupusbharddisk
#tar -zcvf project.tar.gz functions
I had no backup. Similarly I end up running rsync command and deleted all new files by overwriting files from backup set (now I have switched to rsnapshot)
Quote#rsync -av -delete /dest /src
Again, I had no backup when I typed the rsync command.
Deleted Apache DocumentRootI had sym links for my web server docroot (/home/httpd/http was symlinked to /www). I forgot about symlink issue. To save disk space, I ran rm -rf on http directory. Luckily, I had full working backup set.
Accidentally Changed Hostname and Triggered False AlarmAccidentally changed the current hostname (I wanted to see current hostname settings) for one of our cluster node. Within minutes I received an alert message on both mobile and email.
Quote#hostname foo.example.com
Public Network Interface ShutdownI wanted to shutdown VPN interface eth0, but ended up shutting down eth1 while I was logged in via SSH using the ifconfig command:
Quote#ifconfig eth1 down
Firewall LockdownI made changes to sshd_config and changed the ssh port number from 22 to 1022, but failed to update firewall rules. After a quick kernel upgrade, I had rebooted the box. I had to call remote data center tech to reset firewall settings. (now I use firewall reset script to avoid lockdowns).
Typing UNIX Commands on Wrong BoxI wanted to shutdown my local Fedora desktop system, but I issued halt on remote server (I was logged into remote box via SSH):
Quote#halt
#service httpd stop
Wrong CNAME DNS EntryCreated a wrong DNS CNAME entry in example.com zone file. The end result – a few visitors went to /dev/null: