The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to set default permissions for newly created FTP account ?

Discussion in 'General Discussion' started by Leo Tse, Aug 15, 2016.

Tags:
  1. Leo Tse

    Leo Tse Member

    Joined:
    Aug 15, 2016
    Messages:
    6
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    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.
     
  2. Leo Tse

    Leo Tse Member

    Joined:
    Aug 15, 2016
    Messages:
    6
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    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!
     
  3. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Permissions should be set for addon FTP accounts without changing anything.

    What issue are you having uploading a dot file?
     
  4. Leo Tse

    Leo Tse Member

    Joined:
    Aug 15, 2016
    Messages:
    6
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    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.
     
    #4 Leo Tse, Aug 16, 2016
    Last edited by a moderator: Aug 16, 2016
  5. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    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.


    What is the application?
     
  6. Leo Tse

    Leo Tse Member

    Joined:
    Aug 15, 2016
    Messages:
    6
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    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.
     
  7. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  8. Leo Tse

    Leo Tse Member

    Joined:
    Aug 15, 2016
    Messages:
    6
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    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!
     
    Infopro likes this.
  9. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Excellent. Thanks for updating the thread.
     
Loading...

Share This Page