Samba: Failed to smbc_opendir: permission denied

Hello,

I’m trying to connect to a smb folder via a smb://some/path/mylogin (in Dolphin) that I can access using this exact same address on Dolphin from a different computer (non-nixos). Sadly, on my nixos it fails with an error:

smbnotifier[633908]: -- Failed to smbc_opendir: Permission denied.

Any idea what I’m missing? I have KDE plasma 6 installed (NixOs 25.11), and my config includes:

{ pkgs, config, ... }: {
  services.samba = {
    package = pkgs.samba4Full;
    # ^^ `samba4Full` is compiled with avahi, ldap, AD etc support (compared to the default package, `samba`
    usershares.enable = true;
    enable = true;
    openFirewall = true;
  };

  services.samba-wsdd = {
    enable = true;
    discovery = true;
    openFirewall = true;
  };

 ### Share to others in the network
  services.avahi = {
    enable = true;
    nssmdns4 = true;
    openFirewall = true;
    publish = {
      enable = true;
      userServices = true;
    };
  };  
}

See also the bug report I created nixos/samba: Failed to smbc_opendir: Permission denied · Issue #484415 · NixOS/nixpkgs · GitHub

Ok, I found the solution: after realizing that I could log in via:

mount -t cifs -o username=myname,domain=somedomain.myuniv.fr //stockage.myuniv.fr/scan/myname /tmp/foo

I tried to see how to specify the domain in Dolphin. This can be done in multiple ways https://superuser.com/questions/145390/entering-domain-information-when-connecting-to-samba-share-in-dolphin, notably by setting as user somedomain.myuniv.fr\myname. Now the problem is solved!

1 Like

hii ikr you solved this one but i just wanna add one more thing you do not need samba4full as you’re just connecting to another machine basically you’re a client not a server so just use pkgs.samba and you’re golden
avahi, ldap, active directory is stuff required only on servers. so you lowkey have some bloat on your system rn and potentially unwanted network services…
i’m running samba server + bunch of computers on different platforms connecting to it on debian everything i needed to add to my system packages to be able to see and access it is samba and cifs-utils. if you wonder look what’s provided with the basic package, i’m sure that’s more than enough :ok_hand:

Thanks, you are right but I was using it as a server in a different part of my config. This was needed to enable auto-discovery via avahi, even if I also needed to apply extra weird steps to enable auto-discovery. Have you ever experimented with auto-discovery? If so I’d love your thoughts on Samba not discovered accross network

1 Like