File permission on Amazon EC2 with both Filezilla and WordPress

  1. I can allow user ec2-user (Amazon AWS) write access to the public
    web directory (/var/www/html):

    sudo chown -R ec2-user /var/www/html 
    

    which allows me to use Filezilla.

    Read More
  2. And I can allow apache write access by:

    sudo chown -R apache:apache /var/www/html
    

    which allows me to install plugins, updates, etc on WordPress.

How can I set the permissions to be able to do both?

Related posts

1 comment

  1. Try the following:

    1. Create a group
    2. Add both users to that group
    3. Make the group own the directory
    4. Change the directory group permissions

    sudo groupadd mygroup
    
    sudo gpasswd -a apache mygroup
    sudo gpasswd -a ec2-user mygroup
    
    sudo chown -R apache:mygroup /var/www/html
    
    sudo chmod -R g+w /var/www/html
    

Comments are closed.