Skip to main content

suPHP and file ownership by FTP

Comments

9 comments

  • cPRex Jurassic Moderator
    Hey there! This definitely sounds like an FTP issue. Is this happening with multiple users and across multiple FTP clients? It sounds like suPHP is behaving as it should, but the file upload is setting the wrong ownership. If my hunch is correct, this is almost certainly a umask issue, and we have a great thread about that here: Can you work through that to see if that resolves the issue?
    0
  • jrprince
    Thanks cPRex, it does happen with every user, even on accounts with multiple ftp accounts"for several years now, actually. I agree that it does sound like it should be fixable perhaps by getting FTP to set the group ownership correctly, but umask doesn't affect ownership, it only affects permissions. In this case though, the default permissions are preferable, 755 for directories and 644 for files, as specified in the suphp.conf file (0022 octal). I'll note that permissions on files/directories created by php running on the server also come out the same way"expected/desired permissions, but ownership is still username:nobody. It is also still curious that changing paranoid_gid_check
    does not actually seem to be honored by suPHP behavoir. I have seen articles on affecting user/group ownership on pure-FTPD through database entries, but that is aimed more at if I were designing a system in which I used the pure-FTPD API to control how it behaved " and maybe that's how cPanel uses it, although by default I don't really have much visibility, or haven't tried to dig into the database behind cPanel to figure out if it's just setting the default group wrong for file-writes on FTP uploads, and I have not been able to find anywhere that I might change something to then change that behavoir.
    0
  • cPRex Jurassic Moderator
    Sorry for that confusion - you're correct that umask would only apply to permissions. Can you let me know how you're uploading the files over FTP. Is this happening through a client or through a browser tool?
    0
  • jrprince
    If uploaded through the File Manager in the cPanel interface, it gets the correct ownership " user and group match. If uploaded through via FTP, SFTP, or even scp, files get user:nobody. I'm glad you asked"I'd done a ton of digging thinking that something must be off about pure-ftpd somehow, but couldn't really find anything really relating to this. Getting the same results with scp hints that it's something outside of the service used to upload I think.
    0
  • cPRex Jurassic Moderator
    Would you be able to submit a ticket to our team? I don't have any other reports of similar behavior that I could find at this time, so it would be best if we could investigate this issue directly on your server.
    0
  • jrprince
    Sure thing. I agree, if anything similar is out there, I've not been able to filter out enoug noise to find the signal.
    0
  • cPRex Jurassic Moderator
    If you do get that ticket submitted please post the number here so I can follow along and keep the community updated.
    0
  • jrprince
    The ticket number is #94226887.
    0
  • cPRex Jurassic Moderator
    Thanks for that - I'm following along now on my end :D
    0

Please sign in to leave a comment.