Samba: Difference between revisions

imported>Santry
Clarify language around user authentication for samba server
imported>Ozkutuk
Add section regarding mounting CIFS share as user
Line 28: Line 28:
password=<PASSWORD>
password=<PASSWORD>
</syntaxhighlight>
</syntaxhighlight>
=== mount as user ===
By default, CIFS shares are mounted as root. If mounting as user is desirable, `uid` and `gid` arguments can be provided as part of the filesystem options:
<syntaxhighlight lang="nix">
{
  fileSystems."/mnt/share" = {
    # ... rest of the filesystem config omitted
    options = ["credentials=/etc/nixos/smb-secrets,uid=1000,gid=100"];
    # or if you have specified `uid` and `gid` explicitly through NixOS configuration,
    # you can refer to them rather than hard-coding the values:
    # options = ["credentials=/etc/nixos/smb-secrets,uid=${config.users.users.<username>.uid},gid=${config.users.groups.<group>.gid}"];
  };
}
</syntaxhighlight>


== Firewall ==
== Firewall ==