Hide files from view in ftp but still allow scripts to process content

Sunlander

Well-Known Member
May 7, 2018
66
4
8
UK
cPanel Access Level
Root Administrator
Hi,

I have a folder on my server where users upload content via ftp. Inside the folder are 2 other folders which contain sensitive information. Is there a way to hide these folders from users who access via ftp - without affecting scripts that run to process content within those folders?

I have seen suggestions to just add a dot before each of the folders I want to hide but apparently doing this will not hide them in ftp view. Also, I am unsure if doing it that way will affect scripts being able to write to them.

Any advice would be most appreciated.

Kind regards
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,300
363
Houston
Hello @Sunlander

I am unaware of a way to do this, and allow the scripts to run as well as the users to be able to access the parent directory. The best solution to this issue is not to have the FTP user and sensitive information in the same folder, you can create an FTP user with access to a specific subdirectory with no access to the directory the sensitive information is stored in, or you may want to move the sensitive information and modify where the scripts look for it.
 

Sunlander

Well-Known Member
May 7, 2018
66
4
8
UK
cPanel Access Level
Root Administrator
Hi Lauren,
thanks for answering. Unfortunately I don't currently have the skills to adapt the code but will have a play. I have found a temporary solution which works for now. Basically I changed the 2 folders to permission of 311 and although they get changed to 777 during the cronjob run (which calls the script) for the rest of the time the content remains invisible. It isn't ideal but at least gives me a chance to figure out a better method to achieve this.

Thanks for your help and giving me some ideas
 
  • Like
Reactions: cPanelLauren