Limit processes in Ubuntu based OSes (protection via Forkbombs)

Very useful especially if you are learning how to use fork() to create multiprocess applications.

Edit the following file:

/etc/security/limits.conf

Then add the line:

*    hard     nproc     X

Where X is the maximum number of processes you want.

A number around 400-500 is pretty much okay.

 

References:

https://askubuntu.com/questions/23533/how-to-protect-ubuntu-from-fork-bomb/23535

 

 

Advertisements