Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SOLVED Hide directories/files from clients in FTP

Discussion in 'General Discussion' started by Mark Coates, Mar 23, 2019.

Tags:
  1. Mark Coates

    Mark Coates Well-Known Member

    Joined:
    Mar 13, 2019
    Messages:
    65
    Likes Received:
    9
    Trophy Points:
    8
    Location:
    Doncaster
    cPanel Access Level:
    Root Administrator
    Hi i have had a look on here and cant find exactly what i require.

    I would like to hide folders from the client when they access via FTP although keeping the folders still their for the system if possible or an alternative.

    I would like their ftp to look like image "mini ftp" as at the minute it looks like "current ftp" as the average use does not require these additional folder access. Ideally access to
    • mail
    • public_ftp
    • public_html
    • sub domains & domains should they be created in the root
    Any help would be awesome!

    Cheers
     

    Attached Files:

  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,272
    Likes Received:
    2,154
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @Mark Coates,

    Can you confirm if you're attempting to restrict access to the directories starting with a period (e.g. .cpanel), or are you looking to simply hide them when someone connects to the account via FTP?

    If you just want to adjust the FTP behavior, you can modify the following Pure-FTPd configuration settings:

    An example of how to modify the Pure-FTPd configuration values is available on the document below:

    How to Enable FTP Passive Mode - cPanel Knowledge Base - cPanel Documentation

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    Mark Coates likes this.
  3. Mark Coates

    Mark Coates Well-Known Member

    Joined:
    Mar 13, 2019
    Messages:
    65
    Likes Received:
    9
    Trophy Points:
    8
    Location:
    Doncaster
    cPanel Access Level:
    Root Administrator
    Hi yes it would be to hide everything from /home/username onwards except the essentials like public_html, mail and database folders if possible
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,272
    Likes Received:
    2,154
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    You can change ProhibitDotFilesRead to yes in the Pure-FTPd configuration file (see my previous post for instructions) to hide directories starting with a period, but keep in-mind this is limited to the FTP service. The directories will remain visible when a cPanel user accesses the account over a service such as SSH or through File Manager.

    Let me know if you have any questions.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    Mark Coates likes this.
  5. Mark Coates

    Mark Coates Well-Known Member

    Joined:
    Mar 13, 2019
    Messages:
    65
    Likes Received:
    9
    Trophy Points:
    8
    Location:
    Doncaster
    cPanel Access Level:
    Root Administrator
    hi @cPanelMichael

    Im not sure if it is linked but i have noticed since i have done this, which is great by the way, the users of FTP can now go right back to the vps root. Although they cannot change or see 99% of the files they can still see the directory structure.

    I have attached images to show this.

    Thanks
     

    Attached Files:

  6. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,272
    Likes Received:
    2,154
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello Mark,

    Can you share the output from the following commands on this system?

    Code:
    cat /var/cpanel/conf/pureftpd/local
    cat /etc/redhat-release
    cat /usr/local/cpanel/version
    Also, to confirm, is the FTP client you are using in the example connecting over the FTP protocol and not the SFTP protocol?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. Mark Coates

    Mark Coates Well-Known Member

    Joined:
    Mar 13, 2019
    Messages:
    65
    Likes Received:
    9
    Trophy Points:
    8
    Location:
    Doncaster
    cPanel Access Level:
    Root Administrator
    Hi @cPanelMichael

    Here are the results

    [root@dedivps-75533 ~]# cat /var/cpanel/conf/pureftpd/local
    cat: /var/cpanel/conf/pureftpd/local: No such file or directory
    [root@dedivps-75533 ~]# cat /etc/redhat-release
    CentOS Linux release 7.6.1810 (Core)
    [root@dedivps-75533 ~]# cat /usr/local/cpanel/version
    11.78.0.20

    I am using FileZilla on ftp port 21

    Thanks
     
  8. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,272
    Likes Received:
    2,154
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    This is the file you must edit to ensure the custom Pure-FTPd configuration settings are preserved. Did you remove this file after testing, or use another method to enable the custom Pure-FTPd settings?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. Mark Coates

    Mark Coates Well-Known Member

    Joined:
    Mar 13, 2019
    Messages:
    65
    Likes Received:
    9
    Trophy Points:
    8
    Location:
    Doncaster
    cPanel Access Level:
    Root Administrator
    hi @cPanelMichael

    No the file is there the one i have been editing. please see attached.

    The 3 images include what is in my configuration file, the location of that file and the sample directory is a complete seperate account using ftp showing that its not being applied.

    after the file has been uploaded i have then used this line in the terminal to reboot the ftp

    /usr/local/cpanel/scripts/setupftpserver pure-ftpd --force
     

    Attached Files:

  10. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,272
    Likes Received:
    2,154
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. Mark Coates

    Mark Coates Well-Known Member

    Joined:
    Mar 13, 2019
    Messages:
    65
    Likes Received:
    9
    Trophy Points:
    8
    Location:
    Doncaster
    cPanel Access Level:
    Root Administrator
  12. Mark Coates

    Mark Coates Well-Known Member

    Joined:
    Mar 13, 2019
    Messages:
    65
    Likes Received:
    9
    Trophy Points:
    8
    Location:
    Doncaster
    cPanel Access Level:
    Root Administrator
    Thanks this has now worked. I think it was using the .cache file too. once i removed this it worked instantly.
     
    cPanelMichael likes this.
  13. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,272
    Likes Received:
    2,154
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hi Mark,

    I'm glad to see it's now working as intended. Thanks for sharing the outcome.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice