Need help please for the permission I was deploying our webapplication to new server, my problem is that everytime I will git pull in root user, when I check my webapplication I get permission denied always. Like for example I will edit the UserController and push to repo and download to my server using git pull. when I visit to Users route I get permission denied.
can you help me please to set up correctly the permission framework I used is Laravel
If i will login using ssh user , this will show on terminal webdev@ip-xxx-xxx-xxx not www-data. now if I will git pull I will get permission denied, that’s why I will sudo su so that I can pull.
this is not logged as root
I change the owner of files and direttories , but after I git pull, and visits my browswer and access the route I edited will show permission denied.
Okay, so you can run sudo -u www-data to become user www-data.
You still won’t be able to do git pull then though, so you should copy the private key from root to www-data as well.