The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Do not fill user's home folder

Discussion in 'General Discussion' started by Fearghal, Apr 20, 2015.

  1. Fearghal

    Fearghal Member

    Joined:
    Apr 16, 2015
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ireland
    cPanel Access Level:
    Root Administrator
    Hi,

    I am currently trying to use cPanel for a slightly different purpose than hosting public facing websites. I need to stop cPanel from automatically adding files to the users home directory such as public_html, public_ftp etc.

    I've tried using a bash script to delete the files after account creation but it doesnt work.

    Can anyone suggest how I could allow WHM to create an account, but not to fill the user directory with the default files?

    Thanks
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,675
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    There's the "Skeleton Directory" feature, but using that that won't prevent the creation of every directory and file. Could you let us know what bash script you are using and how you have implemented it?

    Thank you.
     
  3. Fearghal

    Fearghal Member

    Joined:
    Apr 16, 2015
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ireland
    cPanel Access Level:
    Root Administrator
    Hi Michael

    Thanks, yes ive tried to use the skeleton directory but it still creates all the other files. I would like there to be nothing inside the users folder.

    I tried the following command inside postwwwacct:

    rm -rf /home/virtfs/home/$user/*

    The above command does not work. Any help would be great!
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,675
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    You should not modify or remove files directly from the VirtFS directory. It can result in serious problems with your file system. This is documented at:

    VirtFS

    The home directories of your accounts are stored in:

    /home/$username/

    Thank you.
     
  5. Fearghal

    Fearghal Member

    Joined:
    Apr 16, 2015
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ireland
    cPanel Access Level:
    Root Administrator
    Hi Michael, thanks for that.

    I have placed the script in all 3 of the locations specified in the account creation output but none of them are calling the script.


    Running post creation scripts (/usr/local/cpanel/scripts/legacypostwwwacct, /usr/local/cpanel/scripts/postwwwacct, /usr/local/cpanel/scripts/postwwwacctuser)......Done

    The script is
    #!/bin/bash
    wall called

    I am not getting any broadcasts after creating an account. Do you know why this script is not running?

    Thanks
     
  6. Fearghal

    Fearghal Member

    Joined:
    Apr 16, 2015
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ireland
    cPanel Access Level:
    Root Administrator
    Update:

    Hi Michael,

    I was able to resolve the issue using your standardized webhooks. Everything is working for me now.

    Thanks for your help.
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,675
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page