How to Add a User to CageFS in CloudLinux cPanel?

I’m using CloudLinux with cPanel. I’ve created multiple users, but I realized that none of them are CageFS enabled. I want to ensure that the user is isolated and their access is restricted to their files and directories. Can someone guide me through the process of adding a user to CageFS in CloudLinux cPanel?

You can solve the problem with both the command line and the WHM interface.

Command Line Solution:

Enable CageFS for a single user:

/usr/sbin/cagefsctl --enable <username>

Enable CageFS for all users:

/usr/sbin/cagefsctl --enable-all

Disable CageFS for a user:

/usr/sbin/cagefs --disable <username>

cPanel/WHM Solution:

  1. Go to CloudLinux Manager in WHM.
  2. Then go to Users within CloudLinux Manager.
  3. In the list of users you will find the CageFS toggle option beside each user. Just enable it and you are done.