How to set default permissions for newly created FTP account ?

Leo Tse

Member
Aug 15, 2016
6
1
3
Canada
cPanel Access Level
Root Administrator
Greetings,

I've googled for almost an hour but couldn't find how I could configure default permissions for newly created FTP accounts under each cPanel account. I'm learning to be a server admin.

Here are what I did:
1. I've successfully installed WHM & cPanel on a Centos-7 VPS.
2. I've created a new cPanel account and successfully pointed a domain to the newly created cPanel account.
3. I then created a new FTP account under that new cPanel account.
4. I could connect to the FTP server using FileZilla with the new FTP account's credentials, but I could not upload any files (Error 553).

Does anyone know how I could configure the global setting for FTP? So that every FTP account can read and write on their FTP server upon every new account creation?

Thanks in advance.
 

Leo Tse

Member
Aug 15, 2016
6
1
3
Canada
cPanel Access Level
Root Administrator
I just found that I could read or write usual files like html, css, js, etc. It's the dotfiles that I had problem with. I am trying to upload a .env file since it's mandatory for my web application. Please help, much thanks!
 

Leo Tse

Member
Aug 15, 2016
6
1
3
Canada
cPanel Access Level
Root Administrator
Here is the error returned from FileZilla (FTP):
Code:
Command: CWD /public_html/webapp
Response: 250 OK. Current directory is /public_html/webapp
Command: TYPE A
Response: 200 TYPE is now ASCII
Command: PASV
Response: 227 Entering Passive Mode (192,243,214,195,220,222)
Command: STOR .env
Response: 553 Can't open that file: Permission denied
It returned a 553 permission denied error if I tired uploading the .env file; other than that, it would return a 550 Could not delete error if I tried to delete any existing dotfile.
 
Last edited by a moderator:

Infopro

Well-Known Member
May 20, 2003
17,113
507
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
Uploading a file and opening a file on the server are two different things of course. Your error says it can't open that file.
Uploading a file via Filezilla should leave that file owned by you.

I suppose you could try renaming the file, upload it to the server and then change the name of the file back again.


I am trying to upload a .env file since it's mandatory for my web application.
What is the application?
 

Leo Tse

Member
Aug 15, 2016
6
1
3
Canada
cPanel Access Level
Root Administrator
It's a web app built with a PHP framework called Laravel (ver. 5.2).
I think it's caused by directory permissions of the FTP accounts/Apache, or some sort of initial settings on cPanel that I missed. Because I couldn't even edit and save the .env file using File Manager.
 

Infopro

Well-Known Member
May 20, 2003
17,113
507
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter

Leo Tse

Member
Aug 15, 2016
6
1
3
Canada
cPanel Access Level
Root Administrator
Yes, you're absolutely correct, FTP account's permissions were set correctly when it was created.

I finally figured it out what happened. It's a silly mistake caused by myself. I logged in as root to install some cPanel plugins and forgot to logout and git-cloned the web app to the public_html directory; thus the web app directory belongs to root and the FTP account has limited access in there.

Thank you for answering my questions!
 
  • Like
Reactions: Infopro