0

I've a problem with permissions/users on my new server. I moved my wordpress blog to a new CentOs server. In this server I've been provided with an ftp user. If I upload a file via FTP with this users, as expected the owner is this user, and the group is the default group for this user.

All my wordpress files has 755 permissions, like in the old server.

Let's take for example a template. If I want to edit it by the internal editor of wordpress, it works with 775, but not with 755. I've made some resarches as I'm not great in sysadmin, and I think that the problem is that when I access to wordpress, I'm not recognoized as the owner of the file, while I didn't had this problem on the old server with the same permissions for the file. How can I fix this?

I've full access on this server.

Thanks.

testermaster
  • 121
  • 1
  • 7
  • 1
    What user is your httpd running as? I'm going to guess it's different to the user you're logging into ftp with. – Sobrique Dec 10 '14 at 13:01

1 Answers1

1

It's quite commmon for the webserver to be running on a technical account.

To allow users to interchange files, these users are in the same group as the webserver. Once you change your files to group write access (assuming the group ist already shared with the webservers process) allows wordpress (i.e. the webserver) to write those files. Therefore 775 works.

Maybe you could check, who's the owner of a file created from the webserver itself, not injected via ftp.

As a solution you could start the webserver with the same account as your ftp user (or drop pivileges to that user) - assuming you have "full access" ("root access") and are able to modify your webserver configuration enough to start as an other user. But that might be more difficult to achieve, than doing the chmod.

user3188140
  • 151
  • 3
  • Hello, when I create a file with webmin (my control panel) the owner user is "root", owner group is "root". Both user and group are different from the ones that I've when I work via FTP. How can I give my FTP user the permission to edit files? I mean, I use to use filezilla, so it'd be better if when I upload a file then I can write on it directly from wordpress... – testermaster Dec 10 '14 at 13:13
  • Want also to add, even if I change the file user owner and group to "root" and "root", I'm not allowed to write on the file with 755. So maybe that even root isn't the technical account? – testermaster Dec 10 '14 at 13:14
  • If your webmin installation is similar to http://www.webmin.com/apache.html (especially 8.) then your webmin-scripts are setuid root - which enables them to create files as root. – user3188140 Dec 10 '14 at 13:18
  • Running webserver as root would be a bad choice in respect of security. – user3188140 Dec 10 '14 at 13:20
  • I just tried again to modify file owner user and group to root, but with 755 I haven't been able to edit the file direclty from wordpress.. :/ – testermaster Dec 10 '14 at 13:24