# Cannot access /usr/src directory via smb



## alex (Sep 24, 2022)

Hello,
i'am trying to learn smb on freebsd and i tried to use the example in
https://docs.freebsd.org/en/books/handbook/network-servers/
I used this smb4.conf file.

```
[global]
workgroup = WORKGROUP
server string = Samba Server Version %v
netbios name = ExampleMachine
wins support = Yes
security = user
passdb backend = tdbsam

# Example: share /usr/src accessible only to 'developer' user
[src]
path = /usr/src
valid users = developer
writable  = yes
browsable = yes
read only = no
guest ok = no
public = no
create mask = 0666
directory mask = 0755
```




But all I get when I try to access the share(linux client: opensuse) is "permission denied".

```
linux:/home/as # mount -t cifs -o username=as //idun/usr/src /mnt/
Password for as@//idun/usr/src:
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
```
I'm able to ping my FreeBSD machine with the samba server.

Here are the samba logs:
/var/log/samba4/log.nmbd:




var/log/samba4/log.smbd:



/usr/src permissions:




i installed samba via pkg install samba431 on Freebsd 13.1
Help would be nice,
Thanks.


----------



## im (Oct 5, 2022)

First of all, try to run simplified configuration: without password authorizations.
Also, try to use native windows client to avoid non-native client issues.
Here is an example of simple config.
You can use it for basic samba setup. Add another required options step-by-step.


```
[global]
  netbios name=SMB
  workgroup = WORKGROUP
  server string =
  log file = /var/log/samba4/log.%m
  max log size = 500
  socket options = TCP_NODELAY
  security = user
  hosts allow = 192.168. 127.
  load printers = no
  guest account = im
  map to guest = Bad User
   interfaces = 192.168.83.1/24
   socket address = 192.168.83.1
   bind interfaces only = yes
   local master = no
#   os level = 128
    os level = 16
   domain master = no
   preferred master = no
   dns proxy = no

# Use extended attributes to store file modes
    store dos attributes = yes

[documents]
  comment =
  path = /home/im/shares/documents
  public = yes
  writable = yes
  read only = no
  create mask = 0777
  directory mask = 0777
  guest ok = yes
  guest only = yes
```

You must tune important options:
  hosts allow = 192.168. 127.
  guest account = im
   interfaces = 192.168.83.1/24
   socket address = 192.168.83.1
Aslo you must create FreeBSD user with a same name as equal a value of "guest account ="


----------

