From 60ae2ba7b308130f32eaa74018de8589c91d4c9c Mon Sep 17 00:00:00 2001 From: Rob Date: Wed, 17 Jan 2024 06:40:23 +0000 Subject: [PATCH] =?UTF-8?q?SMB=20shares=20komplett=20eingerichtet.=20Zugri?= =?UTF-8?q?ff=20f=C3=BCr=20alle=20unbeschr=C3=A4nkt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/smb.nix | 79 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 59 insertions(+), 20 deletions(-) diff --git a/modules/smb.nix b/modules/smb.nix index 3b1bbe7..6f1f116 100644 --- a/modules/smb.nix +++ b/modules/smb.nix @@ -7,6 +7,11 @@ openFirewall = true; }; + # Curiously, `services.samba` does not automatically open + # the needed ports in the firewall. + networking.firewall.allowedTCPPorts = [ 445 139 ]; + networking.firewall.allowedUDPPorts = [ 137 138 ]; + services.samba = { enable = true; enableNmbd = true; @@ -15,32 +20,72 @@ extraConfig = '' workgroup = WORKGROUP server string = BFDS - # netbios name = BFDS + netbios name = BFDS server role = standalone server + map to guest = bad user log file = /var/log/samba/smbd.%m max log size = 50 - #dns proxy = no - #security = user - #use sendfile = yes - #max protocol = smb2 + # dns proxy = no + # security = user + # use sendfile = yes + # max protocol = smb2 # note: localhost is the ipv6 localhost ::1 - #hosts allow = 192.168.0. 127.0.0.1 localhost - #hosts deny = 0.0.0.0/0 - #guest account = nobody - map to guest = bad user + # hosts allow = 192.168.0. 127.0.0.1 localhost + # hosts deny = 0.0.0.0/0 + # guest account = nobody ''; shares = { - public = { - path = "/bfds-nix/"; ## "/mnt/Shares/Public"; + Rob = { + path = "/bfds-nix/rob"; browseable = "yes"; "writable" = "yes"; - #"guest ok" = "yes"; + "guest ok" = "yes"; "public" = "yes"; - "force user" = "share"; - + }; + + Peggy = { + path = "/bfds-nix/peggy"; + browseable = "yes"; + "writable" = "yes"; + "guest ok" = "yes"; + "public" = "yes"; + }; + + Musik = { + path = "/bfds-nix/music"; + browseable = "yes"; + "writable" = "yes"; + "guest ok" = "yes"; + "public" = "yes"; + }; + + Filme = { + path = "/bfds-nix/movies"; + browseable = "yes"; + "writable" = "yes"; + "guest ok" = "yes"; + "public" = "yes"; + }; + + "Hörbücher" = { + path = "/bfds-nix/hoerbuecher"; + browseable = "yes"; + "writable" = "yes"; + "guest ok" = "yes"; + "public" = "yes"; + }; + + ebooks = { + path = "/bfds-nix/ebooks"; + browseable = "yes"; + "writable" = "yes"; + "guest ok" = "yes"; + "public" = "yes"; + + #"force user" = "smbuser"; #"create mask" = "0644"; #"directory mask" = "0755"; #"force user" = "smbuser"; @@ -48,10 +93,4 @@ }; }; }; - - # Curiously, `services.samba` does not automatically open - # the needed ports in the firewall. - networking.firewall.allowedTCPPorts = [ 445 139 ]; - networking.firewall.allowedUDPPorts = [ 137 138 ]; - }