1

I have a shared samba drive set up on my virtual machine guest running Ubuntu Server 12.04.

\\ubuntu\www

The file path /var/www has the permissions www-data:www-data set up. My user name abe is part of the group www-data.

I am using a Windows XP Host machine and I do my development using my host machine, but I just save the files to the samba shared \\ubuntu\www.

When I do so, the file owner gets set to my username abe, which is expected...

Question: is there a way to set up my samba shared at \ubuntu\www to write to my group (www-data) instead of my username?

Here is what my samba configuration file (/etc/ looks like:

[www]
comment = Apache Document Home
path = /var/www/
writable = yes
force group = www-data

2 Answers 2

2

I am a little confused. If you want the owner to be set to www-data:www-data, then add

force user = www-data

Or are you saying that the files are not being created with the correct group name (www-data)?

3
  • I want the files to be written as www-data:www-data instead of abe:www-data
    – AbeP
    May 29, 2012 at 18:55
  • Okay, then my answer will achieve this. Since you set the user owner already to www-data, the www-data user already exists.
    – reverendj1
    May 29, 2012 at 19:04
  • Thanks, I tried writing a file from my host machine and the permissions were set to www-data:www-data
    – AbeP
    May 29, 2012 at 19:19
1
chown abe:www-data /var/www
chmod g+s /var/www

It shall force the group of the future created files :)

1
  • This would just to "force" the group of future created files, to be the same as the group-ownership. Since your question said that "it's okay" if the file have your user as owner, i thought that just the group shall be "forced" ;)
    – user122772
    May 29, 2012 at 19:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .