Skip to content

Instantly share code, notes, and snippets.

@bajpangosh
Last active September 20, 2022 06:30
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bajpangosh/f3ed4a72ad4018848cc2377d2513c7bc to your computer and use it in GitHub Desktop.
Save bajpangosh/f3ed4a72ad4018848cc2377d2513c7bc to your computer and use it in GitHub Desktop.
Ubuntu and www:data permissions in amazon AWS EC2
Every time I have to go to terminal, ssh and do this to change the permissions between Joomla (www-data) and FileZilla (ubuntu)
sudo chown -R www-data.www-data /var/www/html (Joomla)
sudo chown -R ubuntu /var/www/html (File Zilla)
How do I set it so that I don't have to change this every time?
Solution
Add the ubuntu user to the www-data group
# sudo usermod -a -G www-data ubuntu
then
# sudo chmod g+w /var/www/html -R
(group writeable) all your files.
then
# sudo reboot
sudo groupadd www-data
sudo usermod -a -G www-data ec2-user
sudo chown root:www-data /var/www/html
sudo chmod -R 775 /var/www/html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment