I have a web application running on Ubuntu 14.04. The app's deployment service creates separate users, groups and permissions automatically when deploying the app to my server on AWS.
The app runs as a user called nginx which is part of a group also called nginx. When I ssh in I must do so as another user: michaelmichael. I am not part of the nginx group.
The app has a /tmp/cache dir that I must be able to write to as the michaelmichael user in order to manually initialize some settings. When I attempt to do so, I get a 'permission denied' error.
My next step is to check the permissions for the folder. Things start to get confusing. The directory is symlinked so that it can refer to multiple iterations of the application. So, for example, the actual directory that I try to write to is /var/deploy/my-app/web_head/releases/20150221204050/tmp/cache If I ls -l on this directory I get the following:
lrwxrwxrwx 1 nginx nginx 43 Feb 21 20:40 /var/deploy/my-app/web_head/releases/20150221204050/tmp/cache -> /var/deploy/my-app/web_head/shared/cache
If I ls -l /var/deploy/my-app/web_head/shared I can see that cache is a directory with the following permissions:
drwxrwxr-x 14 nginx nginx 4096 Feb 21 20:31 cache
So, in order to write to this directory, do I need to add my user, michaelmichael to the nginx group? Do I need to modify the permissions of the symlinked directory (the /releases/ dir), or the directory itself (the cache dir)?