I'm trying to achieve the following, in order to access samba shares from a Windows XP box:
Live users get a home directory which can be accessed with full permissions through samba if they are authenticated as the owner. I have this working with the following samba config settings:
####### Authentication ####### security = user encrypt passwords = yes passdb backend = tdbsam obey pam restrictions = yes unix password sync = yes passwd program = /usr/bin/passwd %u passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdate$ pam password change = yes map to guest = bad user ####### Shares ####### [homes] comment = %S path = /home/%S allow hosts = 127. 192.168.1. valid users = %S browseable = yes writable = yes create mask = 0700 directory mask = 0700
This is pretty much working a expected, apart from the right permissions being set when I create files and directories. But I read some other answers that talk about tinkering with different
mask variants. So I'll probably get that fixed, so: so far so good.
What I'd like to have additionally, is another folder (
music) that can be accessed with full permissions by me (let's say
myusername), and only read permissions by guests (that don't need to authenticate to access these folders).
I created a group called
music and a user called
music with a home directory
/home/music, and also added
myusername to the group
music. Then I tried the following samba config:
[music] comment = %S path = /home/music allow hosts = 127. 192.168.1. browsable = yes writable = yes read list = @music write list = myusername create mask = 0700 directory mask = 0700
However, logging in on this samba directory as
myusername from Windows XP didn't let me create files and/or directories. Could this be because of conflicts with the
[homes] setting (since it is already referring to directories in
/home as well)? Or am I misunderstanding the principles of user/group permissions?
Apart from that, I also started thinking: do I even need to create the group and user
music to begin with? It appears to be a bit redundant when they wouldn't have write access to begin with anyway. Couldn't I simply create the directory
sudo (or another suggestion perhaps?), and use the above samba settings.
Whichever way, I do like to have this folder on the
/home partition (it's on a separate HDD being the only partition on that HDD). I consider this kind of as my 'data' partition, not merely 'user data'. Or is that frowned upon, in general?
As you can see, I'm having a bit of difficulty with thinking of a good permissions strategy and coming up with the right samba config setting.
Could you shed some light on how I could best achieve what I am trying to accomplish?