With the widespread adoption of version control systems such as Git, customers increasingly expect access to Git directly within their hosting environment.
In a CloudLinux CageFS environment, providing Git access doesn't pose significant security risk when implemented correctly. CageFS isolates users at the file system level, making Git safe and practical for shared hosting users who require SSH access.
Installing Git on the Server
First, install Git using the system package manager:
yum install gitConfirm the installation was successful:
git --version
Enabling Git in CageFS
By default, newly installed packages are not automatically available inside CageFS. You must explicitly add Git to the CageFS skeleton, and manually push a rebuild of the CageFS environment.
Add the Git RPM to CageFS:
cagefsctl --addrpm gitForce a CageFS update to apply the change for all users:
cagefsctl --force-update
Once the CageFS rebuild completes, the git binary will be available inside CageFS via SSH for all users.