# [SOLVED] Trying to create several public shares in Samba

## mscharley

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:

```

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

----------

## cwr

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

Will

----------

## mscharley

Not really. The only example I could find in smb.conf.default is the following group based solution:

```

;[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.

----------

## cwr

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

Will

----------

## kimmie

You can just set "force user" to whatever you want for each share, eg.

```
[tmp]

   path = /tmp

   guest ok = yes

   read only = no

   force user = apache
```

----------

## mscharley

Hey, that's working perfectly.

Awesome, thanks Kimmie

----------

## kimmie

np   :Smile: 

----------

