Different user for connection and project owner

I am using trellis to deploy my project, however I don’t know how to separate connection and web user.
To be specific, my /var/www directory owner is www-data:www-data with chmod 775
I am connecting as user ubuntu, which has no rights to clone/mkdir there.

How can I solve this issue? User ubuntu could be doing all operations with sudo, and then run chown with web user:web group? Or there is better approach?

Is there any built in mechanism for that or I have to edit ansible manually? This looks like a common case to me.

Yes — use a fresh Ubuntu server that you provision with Trellis

1 Like