Create the CageFS Configuration for bc
Run the following command to allow bc inside CageFS:
echo "[bc] comment=BC inside of CageFS. paths=/usr/bin/bc" > /etc/cagefs/conf.d/bc.cf
Apply Changes to CageFS
Update CageFS to reflect the new configuration:
cagefsctl --force-update
Verify bc as a User
Switch to a CageFS-enabled user and test bc:
su - username bc -v
If bc is still not found, try enabling CageFS for the user and reapply updates:
cagefsctl --enable username cagefsctl --force-update
Then, check again:
bc -v
Important Notes
✅ This solution is only for CloudLinux servers using CageFS.
✅ Ensure the user is inside CageFS for bc to work properly.
✅ bc is a basic calculator command available in most Linux distributions.
This method ensures that the bc command is accessible for users inside CageFS on CloudLinux servers. 🚀