CageFS lets a CloudLinux server administrator control which files and executables are available inside users’ isolated filesystems. To make a command unavailable, exclude its executable through the custom blacklist.
Before you start
You need root access to a CloudLinux server with CageFS installed. A shared hosting user cannot normally change the server’s CageFS configuration; contact your server administrator if you do not have that access.
This procedure changes the shared CageFS filesystem and can affect multiple users. Check whether their applications or scripts depend on the command.
Identify the executable
In the server’s root shell, check the command’s path. For example:
command -v dfCloudLinux’s documented example uses /bin/df. Your system may use a different path, such as /usr/bin/df. Check the executable paths available inside CageFS as well; excluding one path does not establish that every alternative executable is unavailable.
Update the custom blacklist
Open the following file in a text editor as root:
/etc/cagefs/custom.black.listAdd the full path of each file to exclude on a separate line. For a system where the target executable is /bin/df, add:
/bin/dfPreserve the existing entries. Do not edit /etc/cagefs/black.list, which is replaced during CageFS package updates.
Apply the change
Run the following command as root:
cagefsctl --force-updateCheck the output for errors before testing access.
Verify access inside CageFS
Open a new session for an affected user who has CageFS enabled and try the command. Confirm that the excluded executable is unavailable and that any dependent applications still work as expected.
A test in the server’s root shell does not test the user’s CageFS environment. This procedure excludes specified files; it is not a guarantee that equivalent functionality cannot be provided by another executable.