Do not fill user's home folder

Fearghal

Member
Apr 16, 2015
7
0
1
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,218
463
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.
 

Fearghal

Member
Apr 16, 2015
7
0
1
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!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,218
463
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.
 

Fearghal

Member
Apr 16, 2015
7
0
1
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,218
463
I am happy to see the issue is now resolved. Thank you for updating us with the outcome.