Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Trying to create several public shares in Samba
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
mscharley
n00b
n00b


Joined: 17 Feb 2012
Posts: 7

PostPosted: Sun Feb 19, 2012 10:09 am    Post subject: [SOLVED] Trying to create several public shares in Samba Reply with quote

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
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1969

PostPosted: Sun Feb 19, 2012 1:41 pm    Post subject: Reply with quote

Isn't there an example of this in the sample /etc/samba/smb.conf?

Will
Back to top
View user's profile Send private message
mscharley
n00b
n00b


Joined: 17 Feb 2012
Posts: 7

PostPosted: Tue Feb 21, 2012 7:55 am    Post subject: Reply with quote

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
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1969

PostPosted: Tue Feb 21, 2012 9:09 am    Post subject: Reply with quote

Yes, that was the example I was thinking of; sorry it doesn't match.

Will
Back to top
View user's profile Send private message
kimmie
Guru
Guru


Joined: 08 Sep 2004
Posts: 531
Location: Australia

PostPosted: Tue Feb 21, 2012 10:26 am    Post subject: Reply with quote

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
View user's profile Send private message
mscharley
n00b
n00b


Joined: 17 Feb 2012
Posts: 7

PostPosted: Tue Feb 21, 2012 9:23 pm    Post subject: Reply with quote

Hey, that's working perfectly.

Awesome, thanks Kimmie
Back to top
View user's profile Send private message
kimmie
Guru
Guru


Joined: 08 Sep 2004
Posts: 531
Location: Australia

PostPosted: Tue Feb 21, 2012 11:32 pm    Post subject: Reply with quote

np :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum