• I have a WordPress site installed in a folder /home/www/john on my server. This folder and everything inside it is owned by user www-data.

    Currently, user john can NOT create or modify files inside this folder /john (I guess because it is owned by www-data, and permissions are classical 755 permissions). But I need user john to be able to do that (john is a client of mine and he needs to sometimes tweak the plugins, etc).

    I have tried to make user john the owner of all the files and folders inside folder /john, but it breaks the wordpress site (I have read WordPress needs the files to be owned by www-data in order to work properly).

    So what would be the best way to give user john the possibility to modify the files and folders without breaking the site?

    • This topic was modified 2 years, 12 months ago by Jan Dembowski.
Viewing 2 replies - 1 through 2 (of 2 total)
  • I recently had to solve a similar problem on my personal VPs. In my case, I’m using the WordOps script and followed the instructions here:

    https://docs.wordops.net/how-to/add-ftp-users/

    The instructions are generic (ie not specific to WordOps), so should be able to adapt the commands to your specific case.

    UPDATE

    Note that the above tutorial essentially adds the user john to the group www-data (which user www-data also belongs).

    Making user john a member of the www-data group means user john will be able to read/write all files and directors that user www-data (which belongs to same group) can.

    If this is not desired, do this instead:

    1) Create anew group
    2) Make both users john and www-data members of this new group
    3) Assign this new group to the directly that you need both users john and www-data to be be able to read/write.

    See this Stack Exchange Q&A for specific commands if needed: https://unix.stackexchange.com/questions/154776/create-files-that-both-www-data-and-myuser-can-edit

    • This reply was modified 2 years, 12 months ago by George Appiah.
    Thread Starter su1

    (@su1)

    Hi @gappiah ,
    thanks for the reply.

    But if I do that, I also need to change my folder permissions to 775 instead of 755, no? Otherwise john still has permission “5”, which is read and execute only, not write.

    And I read 755 is the recommended permission for WordPress, so I’m afraid setting it to 775 would break something or cause security issues.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Give ftp user right to modify files without breaking wordpress’ is closed to new replies.