Knowledge Base Hub

Browse through our helpful how-to guides to get the fastest solutions to your technical issues.

Home  >  Web Host Manager  >  How To Enable Shell Fork Bomb Protection In WHM?
Top Scroll

How To Enable Shell Fork Bomb Protection In WHM?

 2 min

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.

For our Knowledge Base visitors only
Get 10% OFF on Hosting
Special Offer!
30
MINS
59
SECS
Claim the discount before it’s too late. Use the coupon code:
STORYSAVER
Note: Copy the coupon code and apply it on checkout.