Remove "public_html" from default FTP Account path

simple_joe

Member
Aug 5, 2010
7
0
51
Hello, my users don't want their FTP folders to be in the publicly accessible www folder, so in the past I've been able to remove the "public_html" from the default FTP directory path (when a user creates a new FTP Account) by editing this file:
/usr/local/cpanel/base/frontend/x3/js2-min/ftp/accounts.js

But I just updated cPanel today and now this edit no longer works. Any ideas how I could still achieve this?

ps: if helpful, the original thread where I got solution that no longer seems to work is here:
https://forums.cpanel.net/threads/customizing-the-directory-path-for-ftp-users.162002
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,202
363
Hello,

Have you considered disabling FTP access for the default account and simply requiring virtual FTP accounts for all users? Documentation on this is available at:

How to Deny FTP Access

Thank you.
 

simple_joe

Member
Aug 5, 2010
7
0
51
Hi, the default account is used by customers to navigate to the other FTP Accounts setup in cPanel, so I need to leave that enabled.

Essentially, If I could figure out which file cpanel is using when creating the accounts, I should be good to go. Apparently it is no longer using usr/local/cpanel/base/frontend/x3/js2-min/ftp/accounts.js so does anyone know which file it uses now?

thanks,
Joseph
 

simple_joe

Member
Aug 5, 2010
7
0
51
Well I figured out that in version 11.48.4, I was able to edit /usr/local/cpanel/base/frontend/x3/ftp/list_ftp.tt to remove the onchange="suggest_homedir()" and it no longer fills in "public_html" for the FTP Account path. Of course I made a backup and tested it within my own config to make sure all still ran smooth on my particular server.

Just a note: I really think cPanel should stop assigning all those FTP Accounts to be subfolders of the WWW directory, which makes them publicly accessible by default.

hope this helps
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,202
363
Just a note: I really think cPanel should stop assigning all those FTP Accounts to be subfolders of the WWW directory, which makes them publicly accessible by default.
I am happy to see the issue is now resolved. Thank you for updating us with the outcome. Note you can open a feature request for the suggested change via:

Submit A Feature Request

Thank you.