Knowledgebase

How to hide subdirectories in CageFS

In CageFS, you can hide subdirectories using the "Hide Directories" feature. This feature allows you to hide specific directories from users within their CageFS environment.

Here's how you can do it:

  1. Log in to the Server as Root:

    You'll need root access or sudo privileges to perform this action.

  2. Edit the CageFS Configuration File:

    Open the CageFS configuration file for editing. This file is typically located at:

    bash
/etc/cagefs/cagefs.mp

Use your preferred text editor to open the file. For example:

bash

 

  • sudo nano /etc/cagefs/cagefs.mp
  • Add Directories to Hide:

    In the configuration file, you'll see a list of directories. Add the directories you want to hide from users. For example:

    bash
  • /home/user1/public_html/subdirectory /home/user2/public_html/hidden_dir

    Replace user1 and user2 with the actual usernames and subdirectory and hidden_dir with the directories you want to hide.

  • Save and Exit:

    Save the file and exit the text editor.

  • Rebuild CageFS:

    After making changes to the CageFS configuration, you need to rebuild CageFS for the changes to take effect. Run:

    bash

 

  1. cagefsctl --remount-all

    This command remounts CageFS with the updated configuration.

  2. Verify the Changes:

    Log in to a user's account that should not see the hidden directories and check if the directories are now hidden.

Please note that modifying the CageFS configuration requires administrative privileges and should be done carefully. Always double-check your changes before saving.

Additionally, ensure you have backups available before making significant modifications to your server configuration. If you're unsure about any of the steps, consider consulting with your hosting provider or system administrator.

 
 
 
  • 0 Users Found This Useful
Was this answer helpful?