Skip to content

install smbserver

sudo apt install samba

disbale nmbd

sudo systemctl disable nmbd sudo systemctl stop nmbd

use default smb.conf

and add following lines

sudo nano /etc/samba/smb.conf

[global]
    workgroup = WORKGROUP
    smb ports = 445 ## only open 445/tcp
    server min protocol = SMB3
    client smb encrypt = required
    fruit:copyfile = yes
    hosts allow = 10. 127.
    map to guest = never  

[transfer]
path = /mnt/raid/smb
writeable = yes
public = no
create mask = 644

[warez]
path = /mnt/raid/warez/data/media
writeable = yes
public = no
create mask = 644

# I changes the permissions to rw-rw-r--
# You should be able to change them to 775 if you need the files to
# be executable
;force create mode = 664
;security mask = 664
;force security mode = 664

# I set the SGID flag here as I thought this is what you wanted
# You could change to 0775
;directory mask = 2775
;force directory mode = 2775
;directory security mask = 2775
;force directory security mode = 2775

add system user to smb

smbpasswd -a

list existing smbuser

pdbedit -w -L

delete smbuser

sudo smbpasswd -x

restart service after changes

systemctl restart smbd.service

show open ports

lsof -i | grep smb
smbd      2691156 root   28u  IPv6 13120918      0t0  TCP *:microsoft-ds (LISTEN)
smbd      2691156 root   29u  IPv6 13120919      0t0  TCP *:netbios-ssn (LISTEN)
smbd      2691156 root   30u  IPv4 13120920      0t0  TCP *:microsoft-ds (LISTEN)
smbd      2691156 root   31u  IPv4 13120921      0t0  TCP *:netbios-ssn (LISTEN)

  • microsoft-ds: Port 445 (für SMB direkt über TCP/IP)
  • netbios-ssn: Port 139 (für SMB über NetBIOS)

source

https://wiki.archlinux.org/title/Samba https://wiki.debian.org/Samba/ServerSimple