MyBB Community Forums

Full Version: File Ownerships
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
On one server, the file owner/group is 'ftp', and on one it's the name of the FTP user itself. I'm getting this info after using the PHP FTP functions to get the contents of a folder. Are they both essentially owned by FTP and they're being displayed differently because they're running different OSs or something, or are they owned by totally different 'things'?? Curious as on the server where the owner/group is the name of the FTP user, I can use chmod/copy/rename/fopen no problem, without having to have any files/folders CHMOD to 666/777, but on the server where the owner is ftp, chmod/copy/rename/fopen return operation not permitted/permission denied errors, and I'm trying to narrow down the cause, and file ownerships seems a likely cause, and I want to see if these two values are fundamentally different or fundamentally the same.
Is the FTP user in the FTP group? If you have ownership set to a group and a user is in the group it'll act the same if the ownership was set to the specific user.
Your post is a bit confusing. I am sure you know how file permissions and ownership work in Linux so I'm not sure exactly what you're asking but I'll take a stab at it...

From what I'm guessing is you are logging into one server as "user" yet the files are owned by "ftp" thus the permissions have to be set so that "world" (last number) is rx (6) unless "user" is in the "ftp" usergroup in which case you can set "group" (second to last number) to 6 instead.

Basically if the FTP service is run as user "ftp" and the FTP service is not set to use the UID of the user connected it will "create" the file under the UID the FTP service is running as and thus making the user "ftp" the owner and not the person connected via FTP.
why dont you use a username and password setting to make the connection, that will avoid the issues you are having, before I moved to MyBB, I made my site use FTP to upload avatars and attachments, etc. and i just created FTP accounts for each (security reasons) that are jailed to those specific folders.
(2011-04-24, 09:35 PM)pavemen Wrote: [ -> ]why dont you use a username and password setting to make the connection, that will avoid the issues you are having, before I moved to MyBB, I made my site use FTP to upload avatars and attachments, etc. and i just created FTP accounts for each (security reasons) that are jailed to those specific folders.

By default, most FTP servers do not use user accounts to assign permissions (much like every HTTP server I've ever seen). Even if you login to FTP with username and password the files might be owned under the FTP service username and not the username you logged into. I think this is the problem Matt is running into because he is logging in under a user account but the files are owned by the FTP service username.
that is not how any of my servers have worked. if I log in as a user account, then the files are owned by the user automatically. this is using PureFTP and proFTP on WHM/cPanel boxes.
(2011-04-24, 11:42 PM)pavemen Wrote: [ -> ]that is not how any of my servers have worked. if I log in as a user account, then the files are owned by the user automatically. this is using PureFTP and proFTP on WHM/cPanel boxes.

That's because you're using cPanel which configures all of the services before you use them. If you manually install a server though you'll see what I mean. Wink
then Matt needs to setup his FTP server correctly Toungue
Or just login under the right user. Wink
(2011-04-25, 02:11 AM)KuJoe Wrote: [ -> ]Or just login under the right user. Wink

that is what i was saying, why would file permissions NOT match the user that is logged in? i would assume that is the default behavior, unless using anonymous login
Pages: 1 2