----- Original Message -----
From: "Karol Pietrzak"
Hello. I have two Samba related questions:
1. Is there a way to set just a password for a share (i.e. not require a username)?
2. A couple of users are using my Samba server, and they all have their home directories in /home/homes, and the name of the share is 'homes'. Thus, 'ls -1 /home/homes' is something like:
/home/homes/user1 /home/homes/user2 /home/homes/user3 /home/homes/user4
I now want to set passwords and usernames for each of these folders, but I want the name of the share to remain as homes. Thusly, here's part of my /etc/smb.conf:
[homes] path = /home/homes writable = yes public = yes read only = no
Can this be done or do I need a share for each directory, like so?
[user1] <snip> ... Karol Pietrzak PGP KeyID: 3A1446A0
To my knowledge, you can't actually assign a password against a resource in samba, but you can get the functionality by creating an account with the name of the share, and the password you want. The user should be prompted for the password and username. Have them put in the share name and password. It's a little more typing and I haven't tried that myself but it should work. I don't think there is much excitement for the password method because it's too easy to specify a group for access or a write list that makes access with security transparent. So I'd use that over passwords unless there is a really good reason not to. Passwords probably aren't an option anyway unless it was added in a recent revision and I just haven't read about it. You can specify the user's home dir with the variable %H. [homeDir] path=%H ... alternatively, you could say "/home/homes/%u". %u would then be substituted for the username upon connect. In this case, anyone not actually having a directory by their name would get a connect error. This would have other uses besides home dirs. You could also offer shares by group. If you have two groups called Sales and Billing. You could make a dir called /home/docs/Sales. Then you use: [DocsDir] path=/home/docs/%g public = no ... The advantage of this over "write list = x y z" is that it is dynamic and the browse list will depend on the user name and group of the person connecting. Hope that helps. John