LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Having a hard time with permissions... (https://www.linuxquestions.org/questions/linux-newbie-8/having-a-hard-time-with-permissions-4175502675/)

jambuntu 04-23-2014 06:04 AM

Having a hard time with permissions...
 
Hi there

I'm pretty new to Linux sysadmin and despite reading lots on file permissions I'm still banging my head against the wall on this one.

I have an Ubuntu VPS which hosts my Drupal website. On this server I have created a new user called deploy. This is the user used by a the code deployment platform that I'm using, DeployHQ, when it connects to the server via SSH. The service connects to the server, uploads files and then should execute the make command provided by the Drupal CLI tool Drush. This command, bascially, retrieves code from repositories and builds the project but all the retrieved files are written to the /tmp directory before being moved into place.

I gave the deploy user a secondary group of www-data and changed all the files within the project to be owned by ubuntu (admin account) and in the www-data group with permissions of 775. I did this because Apache will also need to be able to write to some directories (file uploads).

Having deploy in the www-data group I expected that there would be no issues moving the build from /tmp to the project directory as the command is executed by the deploy user and it should have permissions to change the files in the project directory by definition of it's group but the build does not move. Next I tried changing the primary group of deploy to www-data but still the build doesn't move into place. Unfortunately the only way I can get the Drush make command to execute entirely is to change all files within the project directory to be owned by deploy and in the deploy group which doesn't seem right plus causes problems for Apache.

Where am I going wrong?! The permissions system doesn't seem that complicated but I'm clearly not doing something right.

Any help greatly appreciated...

chrism01 04-23-2014 06:51 AM

Can you show the exact cmd you used and the msg you got, maybe along with a long listing of a few files.

What might help is that if you gave user 'deploy' a secondary group of www-data, try using
Code:

newgrp www-data
http://linux.die.net/man/1/newgrp
at the start of the build; effectively makes www-data the primary group (for user deploy) for rest of the session.

Smokey_justme 04-23-2014 06:58 AM

There should not be any issues from what you've done... The move should go smoothly.. I'm also interested in the exact error, maybe it will tell us something..

jambuntu 04-23-2014 07:17 AM

I'll try running the make with verbose output and get back to you...


All times are GMT -5. The time now is 11:57 PM.