add samba

This commit is contained in:
Kopatz
2025-10-23 10:59:01 +02:00
parent 4cc83041c6
commit 1f219cbb81
3 changed files with 41 additions and 28 deletions

View File

@@ -1,36 +1,42 @@
{
#services.samba-wsdd.enable = true; # make shares visible for windows 10 clients
#networking.firewall.allowedTCPPorts = [
#5357 # wsdd
#];
#networking.firewall.allowedUDPPorts = [
#3702 # wsdd
#];
services.samba.openFirewall = true;
services.samba-wsdd = {
enable = true;
openFirewall = true;
};
users.users.franz = {
isNormalUser = true;
home = "/home/franz";
hashedPassword = "$y$j9T$opts2crrOHbRzHsFzOh/S1$LU3zmC4tKOw43THlOSw6qDXPse.l1ZvcxolN3EP7/ED";
};
# add user to samba with smbpasswd -a
services.samba = {
enable = true;
securityType = "user";
openFirewall = true;
invalidUsers = [
"root"
];
extraConfig = ''
disable netbios = yes
smb ports = 445
workgroup = WORKGROUP
server string = smbnix
security = user
#use sendfile = yes
#max protocol = smb2
# note: localhost is the ipv6 localhost ::1
hosts allow = 192.168.0. 192.168.174.1 127.0.0.1 localhost
hosts deny = 0.0.0.0/0
guest account = nobody
map to guest = bad user
'';
shares = {
homes = {
browseable = "no";
writable = "yes";
settings = {
global = {
"workgroup" = "WORKGROUP";
"server string" = "smbnix";
"netbios name" = "smbnix";
"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";
};
"franz" = {
"path" = "/hdd/shares/franz";
"valid users" = "franz";
"public" = "no";
"writable" = "yes";
"printable" = "no";
};
};
};