This article explains how to deactivate a command in CageFS. It is a safe virtualised file system used in shared hosting environments to isolate each user and improve security. If you want regular users to be prevented from running any specific command, CageFS will help you block them using its traditional blacklist feature.
Follow the steps below to deactivate a command for users within CageFS:
- Edit the custom blacklist file by opening or editing the file /etc/cagefs/custom.black.list.
- Add each file or command you want to block, one per line. For example, to disable the df command:
echo “/bin/df” >> /etc/cagefs/custom.black.list
- Execute the following command to update CageFS:
cagefsctl --force-update
- As a result, regular users will see a “command not found” error when trying to use the disabled command.
Note: The file “/etc/cagefs/black.list” is automatically replaced when the CageFS package is updated. To avoid losing custom changes, always use the “custom.black.list” file.
This way, you can deactivate a command in CageFS. If you require additional assistance, feel free to get in touch with our support team.