I followed this wonderful Stackoverflow answer to set up my Laravel's permissions on my Webserver (using the www-data group and user).
When I ssh to my server, I am logged in as admin
user. I added this user to the www-group:
sudo usermod -a -G www-data admin
but I am not able to create a file in my Laravel's root folder:
➜ laravel git:(production) ✗ touch test
touch: cannot touch 'test': Permission denied
➜ laravel git:(production) ✗ whoami
admin
➜ laravel git:(production) ✗ ls -la
total 1164
drwxr-xr-x 17 www-data www-data 4096 Jun 23 13:39 .
What do I need to change to be able to have www-data
permissions as admin
user?
Not only what do I need to do: What is the best and secure practice?
my idea:
sudo chmod g+w .
This works but this is not following the recommendation.
I am running in this issue because I use GitHub actions to deploy my production server and GitHub uses ssh as admin user.