How to Prevent a Fork Bomb

freezeresourcesrhelulimit

To prevent fork bomb I followed this http://www.linuxhowtos.org/Tips%20and%20Tricks/ulimit.htm

ulimit -a reflects the new settings but when I run (as root in bash) :(){ :|:&};: the VM still goes on max CPU+RAM and system will freeze.

How to ensure users will not be bring down the system by using fork bombs or running a buggy application?

OS: RHEL 6.4

Best Answer

The superuser or any process with the CAP_SYS_ADMIN or CAP_SYS_RESOURCE capabilities are not affected by that limitation, that's not something that can be changed. root can always fork processes.

If some software is not trusted, it should not run as root anyway.

Related Question