Samba-Server minimal

Aus Xinux Wiki
Version vom 10. November 2025, 19:18 Uhr von Thomas.will (Diskussion | Beiträge) (→‎Konfiguration anpassen)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen

Installation eines Samba-Servers (öffentliche Freigabe)

  • apt install samba -y
  • systemctl enable --now smbd
  • systemctl status smbd --no-pager

Freigabe-Verzeichnis anlegen

  • mkdir -p /srv/samba/share
  • chmod 777 /srv/samba/share
  • echo "Samba-Freigabe funktioniert" > /srv/samba/share/info.txt

Konfiguration anpassen

  • nano /etc/samba/smb.conf
[global]
   workgroup = WORKGROUP
   server string = Samba Server
   map to guest = Bad User
   dns proxy = no

[share]
   path = /srv/samba/share
   browseable = yes
   writable = yes
   guest ok = yes
   read only = no
  • testparm
  • systemctl restart smbd

Kontrolle

  • journalctl -u smbd -n 20 --no-pager
  • smbstatus

Test vom Client (z. B. debian-client)

  • apt install smbclient -y
  • smbclient -L //10.20.10.11 -N
  • smbclient //10.20.10.11/share -N

smb: \> ls smb: \> get info.txt smb: \> exit

Optional Mount-Test auf Client

  • apt install cifs-utils -y
  • mkdir /mnt/smb
  • mount -t cifs //10.20.10.11/share /mnt/smb -o guest
  • cat /mnt/smb/info.txt
  • umount /mnt/smb