Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
share|improve this question
add comment

2 Answers

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
add comment
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
add comment

Your Answer

 
discard

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.