easyengine: Unable to access app directory by non-root user

Non-root users are unable to access app/ directory in site due to ownership/permission issues. See -

https://community.easyengine.io/t/www-data-user-does-not-access-wp-app-folder/11578 https://community.easyengine.io/t/sftp-for-eev4-not-able-to-access-wordpress-installation-directory/11560

This needs to be fixed by setting correct file permissions.

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 6
  • Comments: 19 (1 by maintainers)

Most upvoted comments

Here are the steps to setup SFTP as a workaround for now.

  1. Generate encrypted password.
echo -n "your-password" | docker run -i --rm atmoz/makepasswd --crypt-md5 --clearfrom=- | sed 's/\$/$$/g'

  1. Create the SSH host key
ssh-keygen -t ed25519 -f ssh_host_ed25519_key < /dev/null
ssh-keygen -t rsa -b 4096 -f ssh_host_rsa_key < /dev/null
  1. Create the following docker-compose.yml.
sftp:
    image: atmoz/sftp
    restart: on-failure
    volumes:
        - /path/to/target/directory/:/home/<user>/upload
        - /path/to/sftp-keys/ssh_host_ed25519_key:/etc/ssh/ssh_host_ed25519_key
        - /path/to/sftp-keys/ssh_host_rsa_key:/etc/ssh/ssh_host_rsa_key
    ports:
        - "2222:22"
    command: '<user>:<encrypted_password_from_step_1>:e:<user_id_of_user_on_host>'
  1. Start the container.
docker-compose up -d

We’ll be adding it to the EasyEngine blog soon.

Why was this put on the backlog? This seems to be affecting a lot of people, myself included. Can you explain the steps required to manually fix this until the bug is fixed?

The issue is related to the Docker folder itself.

The best way to do it is to add your user to www-data group, and change docker folder under /var/lib permission recursively to 775. Then change the permission on your data folder to force it to keep the group when new files are added by using find /opt/easyengine/sites/yoursite/app -type d | xargs chmod g+s.

And ensure that from the app folder permissions are set to www-data:www-data (or any group you use)

How is this issue still unresolved?! Does anyone have a fix for this? I see @mbtamuli comment about setting up a docker container but I am using a VPS on digital ocean and it comes pre-setup with an SSH and I am unable to get this option to work. I am not sure if it is because of the default setup of the VPS but I have tried following those steps serval times without success and when I set up my sftp access the normal way through the existing setup I am unable to access the app folder with my www-data user.

Any other solution for it ?

Can someone clarify if this is the “blog” you were referring to? I’ve attempted this several times and it fails for me: https://easyengine.io/handbook/configure-sftp-on-ee4-server

Others are reporting the same in the forum