[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[Global exclusive service] Beyond's MSP in North America and China

[Global exclusive service] Beyond's MSP in North America and China

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

New 5 major Linux destruction spells

This is Saito from the infrastructure team.

This time, I would like to take a different approach and introduce dangerous Linux commands in a ranking format. Titled ` `New 5 Great Spells of Destruction''

We also have items that are not ranked.
So let me introduce it to you.

5th place: iptables

sudo iptables -I INPUT -j DROP

● Evaluation point: Stops working instantly

iptables is usually a pain to use, but this command stops working from the moment you type it.

Therefore, it would be very troublesome to do this on a server that cannot be restarted. On the other hand, as long as you restart it, it will still work.

4th place: git

git reset --hard HEAD~3 && git push -u --force origin master

● Evaluation point: Causes trouble for colleagues as well.

Force an overwrite to the remote repository.

By doing this, you will delete all of your coworker's pushes. I'm still not feeling well because I've done a reset. Never do this if you are working with a group of people on a remote repository.

3rd place: chmod

sudo chmod -R 000 /

● Evaluation points: All become zero.

It's a pretty dangerous command, but it's relatively easy to pass.

After the command passes without any problems, you will lose all access privileges within the server. Even in this situation, the pwd command returns the correct display.

2nd place: rsync

mkdir hoge;sudo rsync -av --delete-excluded /hoge/ /

● Evaluation point: No longer synchronized

rsync is a command for synchronizing files, and rsync has many options. Of the many options, many of the necessary options are grouped together by -a.

Therefore, avoid using options labeled delete casually.
Using the above command will sync your empty files and OS and everything will disappear.

1st place:rm

sudo rm -rf / --no-preserve-root

● Evaluation point: It can be erased after all.

In recent OSes, if you enter a command such as rm -rf / to erase everything under /, the OS will say "wait" and the command will not work. Thank you very much.

However, there is an option to nullify such kindness: --no-preserve-root . Now everything disappears.

Not ranked

rm -rf <folder>

● Evaluation points: Easy

Adding sudo is a very dangerous command. This is because you can easily delete folders and files. (Actually, there is a way to return it, but that's for another time.)

This is a command that amateurs cannot easily enter. I think some people might use it depending on the situation, so I'll leave it out of the ranking. Please leave this kind of work to a server engineer.

summary

What did you think?

Your colleagues in the same industry may have had their heart rates increase. Drink some tea and relax.

There are several other dangerous commands, such as fork bomb :(){ :|:& };:, so don't try fork bombs on Docker. There is a precedent for causing fatal damage to the host OS.

All the commands introduced this time were executed on VirtualBox + Vagrant, but sometimes the entire box disappears, or the Vagrantfile permissions or the file itself disappears. Never do this on a business terminal.

That's it.

If you found this article helpful , please give it a like!
15
Loading...
15 votes, average: 1.00 / 115
23,158
X facebook Hatena Bookmark pocket
[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

The person who wrote this article

About the author