Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have my samba config as such:

[global]
    security = user
    guest account = nobody

[media]
    path = /data/media
    browsable = yes
    guest ok = yes
    guest only = yes
    read only = no
    create mask = 0765

Which works fine - windows clients browse to shares as guest and get mapped to the nobody account. However I have a strange problem.

If I have a file owned by nobody, such as:

-rwxrw-r--   1 nobody media   252125 Dec 18  2011 rss.dat

My windows clients can do whatever they like to the file. However if a file is not owned by nobody:

-rwxrw-r--   1 user   media   252125 Dec 18  2011 rss.dat

Then my windows clients can't touch the file, windows always says you need permission from "SERVER\user" to change the file. However nobody is in the media group:

# From /etc/group
media:x:1002:user,nobody

So shouldn't the nobody user be able to change files because of group permissions? Or is there something special with samba I'm missing?

Thanks!

share|improve this question
    
You should be wary of using 'nobody'. This is not its intended use, there are some obscure security concerns with this - much better to add another guest user. See en.wikipedia.org/wiki/Nobody_%28username%29 –  user243298 Feb 4 at 1:57

1 Answer 1

up vote 0 down vote accepted

I think this is a problem because your user does not have media as primary group. Therefore your windows clients try to write the file as user.user instead of user.media. A simple way of fixing this issue is to chown all the files to nobody.media inside of /data/media you are sharing and forcing clients to write as nobody.media . Your smb.conf would look like this

[global]
    security = user
    guest account = nobody

[media]
    path = /data/media
    browsable = yes
    guest ok = yes
    guest only = yes
    read only = no
    create mask = 0765
    force user = nobody
    force group = media
share|improve this answer
    
That's awesome - the force group option did the trick. I can now make my files owned by any user and samba users can edit them still because of the group membership. Thanks!! –  Averenix Feb 6 '13 at 8:37
    
glad I could help –  latz Feb 6 '13 at 10:50

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.