[lug] rsync permissions problem

Hugh Brown hugh at math.byu.edu
Thu Dec 14 17:31:04 MST 2006


Paul Nowosielski wrote:
> Dear All,
> 
> I have a rsync permissions problem that I can't figure out. 
> I have a dev server and a WWW server. I use a simple rsync script to push the 
> files from dev to www.
> 
> On the WWW server /var/www is permissioned 775 wwwrun.www .
> The user who pushes the files is named "back". "back" is in the www  group.
> 
> When I call the script from dev I get all these permission denied errors and 
> Im not sure why because its group WWW writable. 
> The only way I can get this to work is by chmod 777 /var/www then reverting.
> 
> Any idea??
> 
> 


You can add --progress --verbose to your rsync to get more feedback.

There are two sets of permissions here, the permissions on the source 
and on the destination.  I'm assuming:

user at dev $  cd /web/devel/tree
user at dev $  rsync -e ssh -a . back at webhost:/var/www/

If that's the case, then I'd suspect that the ownership in 
/web/devel/tree/ doesn't match for a file in webhost:/var/www

e.g.

  dev:/web/devel/tree/index.html is owned by "user" but on 
webhost:/var/www/index.html it is owned by wwwrun.  If you are using 
--archive (-a) on rsync, then it will try and change the owner from 
wwwrun to "user" and fail.

If that's the problem, then look at turning off user/group preservation.

The other problem would be that "user" on dev is trying to read files 
locally to push up to the www server and it fails there.

You can use -vv options to rsync to get even more verbosity.

A third possibility is that there are subdirectories of webhost:/var/www 
that don't have group write and therefore can't create new files.

HTH,
Hugh



More information about the LUG mailing list