# How do I setup a Samba4 share that does not require any user authentication?



## mrjayviper (Sep 8, 2016)

Since the share is only available on my local network, I would like to setup a share that requires no password.

This is my smb4.conf


```
[global]
load printers = no
workgroup = myworkgroup

bind interfaces only = yes
interfaces = em0 em1
hosts allow = 192.168.1.0/24 192.168.3.0/24
hosts deny = all
security = user

log file = /var/log/samba4/log.%m
max log size = 1000
interfaces = em0 em1
passdb backend = tdbsam

dns proxy = no
min receivefile size=16384
socket options=IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
use sendfile=true

unix extensions = no
nt acl support = yes
inherit acls = no
map acl inherit = yes
vfs objects = zfsacl

[myshare]
path = /Volumes/storage
public = no
writable = yes
printable = no
create mask = 0664
directory mask = 0775
```
I have changed "public" to yes and added "usershare allow guests = yes" but I still get authentication prompt.

Any ideas? Thanks!


----------



## SirDice (Sep 8, 2016)

Add 

```
guest ok = yes
```


----------



## mrjayviper (Sep 8, 2016)

SirDice said:


> Add
> 
> ```
> guest ok = yes
> ```


According to official docs (https://www.samba.org/samba/docs/man/manpages/smb.conf.5.html),  "public" is the same as using "guest ok" .


----------



## SirDice (Sep 8, 2016)

This one also needs to be set:

```
map to guest = Bad User
```
https://www.samba.org/samba/docs/man/manpages/smb.conf.5.html#MAPTOGUEST


----------

