Knowledge Base
MilesWeb / Web Host Manager

How To Enable Shell Fork Bomb Protection In WHM?

Approx. read time : 3 min

Watch this video for a step by step process on How to Enable Shell Fork Bomb Protection In WHM

Shell Fork Bomb protection prevents the SSH/Telnet users from using the complete server resources and thereby causing a system crash. In simple words, this is a script that creates many processes quickly by using fork (). By executing this process, you will be able to prevent the system by filling up the process table to an extent where you can’t even use ‘ps’ and in this case, you won’t be able to detect who did it.

The complete process is mentioned below:

  • Login to WHM with root access.

 

login to whm

 

  • Go to Security Center option from the navigation menu and click on Shell Fork Bomb Protection.

 

security center

 

  • Click on the ‘Shell Fork Bomb Protection’ icon.

 

shell fork bomb protection

 

  • Click on ‘Enable Protection’ in order to enable this feature.

 

enable protection

 

After the protection is enabled, the limits mentioned below are available for protecting the server:

LimitOptionDescription
200000-cLimits the maximum number of core files created.
200000-dLimits the maximum size of the process’s data segment.
200000-mLimits the maximum resident set size.
100-nLimits the maximum number of open file descriptions.
8192-sLimits the maximum stack size.
35-uLimits the maximum number of processes available for a single user.
200000-vLimits the maximum volume of virtual memory available for the process.

Note that the ‘u’ option limits the bash shell users (default for cPanel users) to 35 processes per user.

You can also execute this process through the command line:

  • Login to SSH through root access.
  • Execute the command mentioned below for enabling ‘Shell Fork Bomb Protection.

perl -I/usr/local/cpanel -MCpanel::LoginProfile -le ‘print [Cpanel::LoginProfile::install_profile(‘limits’)]->[1];’

  • Now you have to restart the cPanel service with the command mentioned below.

# service cpanel restart

  • You can also disable the Shell Form Bomb Protection with the command mentioned below.

perl -I/usr/local/cpanel -MCpanel::LoginProfile -le ‘print [Cpanel::LoginProfile::remove_profile(‘limits’)]->[1];’

  • You have to again restart the cPanel service after executing this command.

# service cpanel restart

However, it is recommended to enable this feature through the WHM API. In case you need any further assistance with this process, you can get in touch with our support department.

My aim is to create enriching content on topics related to SEO, web hosting and social media. The idea is to elevate the readers to new levels of usability, accessibility and understanding.
Need help? We’re always here for you.