Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


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:

comment = Apache Document Home
path = /var/www/
writable = yes
force group = www-data
share|improve this question
up vote 2 down vote accepted

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)?

share|improve this answer
I want the files to be written as www-data:www-data instead of abe:www-data – AbeP May 29 '12 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 '12 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 '12 at 19:19
chown abe:www-data /var/www
chmod g+s /var/www

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

share|improve this answer
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" ;) – nwildner May 29 '12 at 19:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.