Source: https://linuxtechlab.com/linux-commands-you-should-never-run-on-your-system/

 

This article refers to some of the Linux commands you should never run on your system as they might prove to be DEADLY for your Linux systems. So before I proceed, I would like to point out that this article is written for information only to let the readers know that executing any of the following commands are to be avoided. All commands mentioned here can have serious repercussions for your system & its data.

So let’s start the list of Linux commands you should never run & might I say again that you proceed with caution,


Linux commands you should never run


1- Format System Disk

Linux Administrator uses this command very often to format and an assign a file system to a newly created disk partition. But when used irresponsibly, this can also format the disk with data on it,

$ mkfs.ext4 /dev/sda

So when using this command, make sure that the intended disk partition has been selected.

2- Delete /etc or /boot directories

/etc holds all the configuration files for the system & /boot holds all kernel, InitRD & GRUB related files, files that are required for system bootup. So delete any of these folders & your system will not boot up,

$ rm -rf /etc

$ rm -rf /boot

Another way to remove configuration files from your system & leave your system to irrecoverable is to use the following command,

$ find / -iname “*.conf” -exec rm -rf {} \;

This will find & remove all the files ending with .conf (configuration files).

3- Delete the entire file system

Most of you might know of this command & it goes like

$ rm -rf /

This will delete the entire file system from your server, deleting every byte of data on disk.

4- Fork Bomb

Now, this command creates copies of itself endlessly & within no time will all your system’s memory, CPU & thus will cause the system crash.

$:(){ :|:& };:

This can also lead to disk corruption.

5- Fill disk with random data

$ dd if=/dev/urandom of=/dev/sda

This will fill the disk with random data. Another variant of this command overwrites the disk several times over the original data,

$ shred /dev/sda

This command is actually a useful tool, especially when you are discarding off the old disk & would not want data from the old disk to fall into wrong hands (& another way I learned from movies is, you can also drill some holes into the drives).

6- File permissions havocs

All the above commands deals with removal or overwriting of data. But there are ways to render your system unusable using the file permissions. First command is ,

$ chmod -Rv 000 /

This command will remove all the file permissions of the all the files or folder on the system & since nobody will have access to files & folders, nobody can access those. & this leads to another way to writing the above command,

$ chown -R nobody:nobody /

This will also accomplish the same output as the first one. Now the second file permission command is actually the opposite of first one,

$ chmod -R 777 /

This will change permissions for all the files & folders to be world writable. & I am sure you can think of what will happen in such a scenario.

Leave a Reply

Your email address will not be published. Required fields are marked *