Skip to main content

Can I set the default file and folder permissions through C-Panel or WHM?

Comments

9 comments

  • hmaddy
    you can try the following command find /home/ -type d -exec chmod 755 {} \;
    0
  • kodeslogic
    Can you confirm how the files are uploaded? Some FTP client or cPanel Filemanager? What are the permissions when you create a test file and folder through the cPanel Filemanager?
    0
  • Outlier
    When the files are uploaded by my FTP client FileZilla, it gives folders permissions of 775 and files 664. When I tried uploading with CPanel's Filemanager, it does give folders my desired permissions of 755 and files 644. The problem with uploading with CPanel's Filemanager is that you can't seem to upload folders and subfolders, you can only upload files. So you have to manually create a folder, then upload files into it. That's also very time consuming especially if your site has thousands of files and folders.
    0
  • kodeslogic
    I suspect you are using SFTP to connect, if I'm correct then you should go through the following old thread [QUOTE]
    0
  • Outlier
    You are correct. I used SFTP to connect and I actually suspected that could be the reason because on my previous servers I used FTP to connect and the permissions were correct. So when I tried connecting using FTP, I get the error "ECONNREFUSED - Connection refused by server" and "Cannot establish FTP connection to an SFTP server. Please select proper protocol". When I looked in cPanel, I realized that the FTP icon is missing. Upon further reading, I found out that cPanel has disabled FTP in versions 86 and later. So you have to enable it if you want it. Good to know for next time...
    0
  • kodeslogic
    New installations of cPanel & WHM have ftpd disabled by default. To enable FTP access from WHM, please follow the below-given steps:
    • Login to WHM interface.
    • Click on icon "Service Configuration".
    • On the next page, click on the icon "FTP Server Selection".
    • You can select Pure-FTPD or Pro-FTPD to enable FTP accounts.
    • Click the "Save" button at the bottom of the page to activate your selection.
    • If you want to edit FTP server configuration to change the settings, navigate to Home "Service Configuration "FTP Server Configuration and modify the settings.
    • Click the "Save" button to change the settings.
    0
  • Outlier
    New installations of cPanel & WHM have ftpd disabled by default. To enable FTP access from WHM, please follow the below-given steps:
    • Login to WHM interface.
    • Click on icon "Service Configuration".
    • On the next page, click on the icon "FTP Server Selection".
    • You can select Pure-FTPD or Pro-FTPD to enable FTP accounts.
    • Click the "Save" button at the bottom of the page to activate your selection.
    • If you want to edit FTP server configuration to change the settings, navigate to Home "Service Configuration "FTP Server Configuration and modify the settings.
    • Click the "Save" button to change the settings.

    Thanks, I wish I had known this before spending hours upon hours of manually changing each file and folder's permissions. I tested it and uploading via FTP indeed gives the proper permissions of 755 for folders and 644 for files. While we're discussing permissions, is the proper permission for the public_html folder supposed to be 750?
    0
  • kodeslogic
    Glad to know the file/folder permission issue is now resolved.
    While we're discussing permissions, is the proper permission for the public_html folder supposed to be 750?

    Yes, 750 is correct permission for the public_html folder.
    0
  • cPRex Jurassic Moderator
    Thanks @kodeslogic :D
    0

Please sign in to leave a comment.