samba4
configurationserverfileserversamba

Samba cheat sheet #

Main configuration file (FreeBSD /usr/local/etc/smb4.conf)

[global]
    workgroup = WORKGROUP
    realm = workgroup.local
    netbios name = NAS

[coderonline]
    path = /home/coderonline
    public = yes
    writable = yes
    printable = no
    guest ok = no
    valid users = coderonline

user accounts must exist, password login not necessarily, because user accounts are handled independant, users added with:

pdbedit -a -u max

list all users on a samba server: pdbedit -L -v

list all users on ldap:

ldapsearch -h localhost -D administrator@local.wireme.de -W -x -b "cn=users,dc=local,dc=example,dc=com"

see all network shares on local network

nmblookup -S '*'

list all shares on a server

smbclient -L 192.168.168.20 -U%

ftp like shell on smb share

smbclient //192.168.168.20/max

network discovery #

nmbd is now replaced with wsdd, the package is called py39-wsdd under FreeBSD.

systemctl start wsdd

That also enables Thunar to “Browse Network” (otherwise empty), uses gvfsd-smb-browse behind the scene.

After changing the uid of a user: No login possible #

Deleting and recreating the user helps. Maybe there is a better method, but I am using this for now:

smbpasswd -x max
pdbedit -a -u max
top