linux in the fork bomb

Learning bash script to see a piece of code (veterans should know) quite interesting, and sometimes do not understand. This command does not require the administrator to run, do not use the following script on your machine, or you know what you're doing

:() { :|: & };:

Reference link: https: //www.geeksforgeeks.org/fork-bomb/

Generally defines a function :( colon)

{: |: &} Represents the function and run it as a background to the pipeline run (recursive), colon represents the last executed immediately, then he would have been this function to generate a new process leading to the formation of a denial of service attack, until the exhaustion of system resources, you can shut down.

Want to prevent this fork bomb, you can modify the configuration file /etc/security/limits.conf in nproc as an administrator, such as hard nproc 100 to limit the maximum number of processes to prevent such attacks.

 

Guess you like

Origin www.cnblogs.com/hhsh/p/11489003.html