Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are you able to share with samba from NixOS? #1

Open
maxdevjs opened this issue Nov 18, 2019 · 2 comments
Open

Are you able to share with samba from NixOS? #1

maxdevjs opened this issue Nov 18, 2019 · 2 comments

Comments

@maxdevjs
Copy link

I have a configuration more or less like yours and I can mount remote resources, but not to share from NixOS.

$ net usershare info --long
net usershare: usershares are currently disabled

In Dolphin the Share tab informs that Samba is not installed (!!!)...

Any clues?

@sjau
Copy link
Owner

sjau commented Nov 20, 2019

Hi have meanwhile altered my configuration.

Since I use wireguard, don't use authentication anymore but give a list of IP addresses that can access my samba:

Open firewall ports:

    networking = {
        ...
        firewall.enable = true;
        firewall.allowPing = true;
        firewall.allowedTCPPorts = [ 139 445 ];
        firewall.allowedUDPPorts = [ 137 138 ];
        ...
    # Samba
    services.samba = {
        enable = true;
        securityType = "user";
        syncPasswordsByPam = true;  # this can probably be removed
        extraConfig = ''
            server string = ${mySecrets.hostname}
            netbios name = ${mySecrets.hostname}
            workgroup = WORKGROUP
            max xmit = 65535
            socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE
            hosts allow = 127.0.0.1 10.20.30.  # 10.20.30.0/24 is my wireguard subnet
            hosts deny = 0.0.0.0/0  # deny access from anywhere else
            security = user
            guest account = ${mySecrets.user}
            map to guest = bad user

            # Disable printer
            printcap name = /dev/null
            load printers = no
            printing = bsd
            show add printer wizard = no
            disable spoolss = yes
        '';
        shares = {
            Desktop = {
                path = "/path/to/share";
                browseable = "yes";
                "read only" = "no";
                "guest only" = "yes";
                "guest ok" = "yes";
                "create mask" = "0644";
                "directory mask" = "0755";
                "hosts allow" = "127.0.0.1 10.20.30."  # probably not needed
            };
        };
    };

@maxdevjs
Copy link
Author

Thank you.

Is that your complete Samba config?
Tried it and a couple Samba versions and still I have the same usershares are currently disabled issue.
What Samba version do you use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants