View previous topic :: View next topic |
Author |
Message |
mscharley n00b
Joined: 17 Feb 2012 Posts: 7
|
Posted: Sun Feb 19, 2012 10:09 am Post subject: [SOLVED] Trying to create several public shares in Samba |
|
|
Hi everyone,
I'm trying to set up Samba with several shares. This is for a home network, so I'm more than happy to have guest only access, and in fact want to do it that way, but several of the shares I want to set up are drop-box style folders for different network services, with different users that need access to them. Originally I was planning to just set up each of these directories as read/write for those users, then set up samba as using that user also for it's guest access but it seems that the 'guest account' parameter is only available at the global level, so that option isn't viable.
Anyone have some advice for how I can set this up?
To help illustrate the problem, I have this:
Code: |
nas # ls -l /mnt/raid
total 0
drwxr-xr-x 1 guest guest 32 Feb 19 07:55 Backup
drwxr-xr-x 1 transmission transmission 16278 Feb 19 07:54 downloads
drwxr-xr-x 1 transmission transmission 166 Feb 19 08:47 incomplete-torrents
drwxr-xr-x 1 guest guest 2652 Feb 19 07:48 Music
drwxr-xr-x 1 apache apache 0 Feb 18 15:58 Webroot
drwxr-xr-x 1 matt matt 0 Feb 18 15:58 Work
|
Last edited by mscharley on Tue Feb 21, 2012 9:23 pm; edited 1 time in total |
|
Back to top |
|
|
cwr Veteran
Joined: 17 Dec 2005 Posts: 1969
|
Posted: Sun Feb 19, 2012 1:41 pm Post subject: |
|
|
Isn't there an example of this in the sample /etc/samba/smb.conf?
Will |
|
Back to top |
|
|
mscharley n00b
Joined: 17 Feb 2012 Posts: 7
|
Posted: Tue Feb 21, 2012 7:55 am Post subject: |
|
|
Not really. The only example I could find in smb.conf.default is the following group based solution:
Code: |
;[myshare]
; comment = Mary's and Fred's stuff
; path = /usr/somewhere/shared
; valid users = mary fred
; public = no
; writable = yes
; printable = no
; create mask = 0765
|
This would work on the Samba side, but for instance, apache/PHP doesn't allow for setting file masks on all files created, so it wouldn't work, hence why I wanted to set guest account at the share level.
Perhaps ACL's? Will ACL's propogate down file trees though? I haven't played with ACL's in linux before. |
|
Back to top |
|
|
cwr Veteran
Joined: 17 Dec 2005 Posts: 1969
|
Posted: Tue Feb 21, 2012 9:09 am Post subject: |
|
|
Yes, that was the example I was thinking of; sorry it doesn't match.
Will |
|
Back to top |
|
|
kimmie Guru
Joined: 08 Sep 2004 Posts: 531 Location: Australia
|
Posted: Tue Feb 21, 2012 10:26 am Post subject: |
|
|
You can just set "force user" to whatever you want for each share, eg.
Code: | [tmp]
path = /tmp
guest ok = yes
read only = no
force user = apache |
|
|
Back to top |
|
|
mscharley n00b
Joined: 17 Feb 2012 Posts: 7
|
Posted: Tue Feb 21, 2012 9:23 pm Post subject: |
|
|
Hey, that's working perfectly.
Awesome, thanks Kimmie |
|
Back to top |
|
|
kimmie Guru
Joined: 08 Sep 2004 Posts: 531 Location: Australia
|
Posted: Tue Feb 21, 2012 11:32 pm Post subject: |
|
|
np |
|
Back to top |
|
|
|