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.

Upload file as root user 404

Discussion in 'General Discussion' started by MrNiles, Feb 26, 2017.

  1. MrNiles

    MrNiles Registered

    Joined:
    Feb 26, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Norwich, UK
    cPanel Access Level:
    Root Administrator
    Hi there

    I'm using SFTP to access the root directory on a new server which I own. If I upload a file to a public_html folder for one of the accounts then the file doesn't appear in the browser. For example if it's the index.html then it'll return a 404 error. However, if I upload the same file using standard ftp as the account owner then the site will function properly.

    In the ftp client the file will show the owner as either 'root' or 'user' but the permissions will stay at 644.

    Can someone tell me what I'm doing wrong and why the files uploaded as root aren't being found?

    Thank you all for your time.

    J
     
  2. sktest123

    sktest123 Well-Known Member

    Joined:
    Jan 31, 2017
    Messages:
    69
    Likes Received:
    3
    Trophy Points:
    8
    Location:
    kochin
    cPanel Access Level:
    Root Administrator
    Check the ownership of files in both cases after uploading.
     
  3. MrNiles

    MrNiles Registered

    Joined:
    Feb 26, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Norwich, UK
    cPanel Access Level:
    Root Administrator
    The ownership reflects the identity of the uploader; 'root' for root and 'accountname' when using normal ftp. Will that be it? If so is there any way to work around it and still use root ftp?
     
  4. vacancy

    vacancy Well-Known Member

    Joined:
    Sep 20, 2012
    Messages:
    122
    Likes Received:
    11
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    You can use apache cgi mode.

    In the suphp mode, file ownership must be the same as the account.
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You'll need to update the ownership of the files you upload as "root" to the account username. You can do this via the "chown" command via SSH. Or, simply login via SFTP as the account username to avoid this issue.

    Thanks!
     
Loading...

Share This Page