Next: , Previous: , Up: Services   [Contents][Index]


12.9.25 Samba Services

The (gnu services samba) module provides service definitions for Samba as well as additional helper services. Currently it provides the following services.

Samba

Samba provides network shares for folders and printers using the SMB/CIFS protocol commonly used on Windows. It can also act as an Active Directory Domain Controller (AD DC) for other hosts in an heterougenious network with different types of Computer systems.

Variable: Scheme variable samba-service-type

The service type to enable the samba services samba, nmbd, smbd and winbindd. By default this service type does not run any of the Samba daemons; they must be enabled individually.

Below is a basic example that configures a simple, anonymous (unauthenticated) Samba file share exposing the /public directory.

Tip: The /public directory and its contents must be world readable/writable, so you’ll want to run ‘chmod -R 777 /public’ on it.

Caution: Such a Samba configuration should only be used in controlled environments, and you should not share any private files using it, as anyone connecting to your network would be able to access them.

(service samba-service-type (samba-configuration
                             (enable-smbd? #t)
                             (config-file (plain-file "smb.conf" "\
[global]
map to guest = Bad User
logging = syslog@1

[public]
browsable = yes
path = /public
read only = no
guest ok = yes
guest only = yes\n"))))
Data Type: samba-service-configuration

Configuration record for the Samba suite.

package (default: samba)

The samba package to use.

config-file (default: #f)

The config file to use. To learn about its syntax, run ‘man smb.conf’.

enable-samba? (default: #f)

Enable the samba daemon.

enable-smbd? (default: #f)

Enable the smbd daemon.

enable-nmbd? (default: #f)

Enable the nmbd daemon.

enable-winbindd? (default: #f)

Enable the winbindd daemon.

Web Service Discovery Daemon

The WSDD (Web Service Discovery daemon) implements the Web Services Dynamic Discovery protocol that enables host discovery over Multicast DNS, similar to what Avahi does. It is a drop-in replacement for SMB hosts that have had SMBv1 disabled for security reasons.

Scheme Variable: wsdd-service-type

Service type for the WSD host daemon. The value for this service type is a wsdd-configuration record. The details for the wsdd-configuration record type are given below.

Data Type: wsdd-configuration

This data type represents the configuration for the wsdd service.

package (default: wsdd)

The wsdd package to use.

ipv4only? (default: #f)

Only listen to IPv4 addresses.

ipv6only (default: #f)

Only listen to IPv6 addresses. Please note: Activating both options is not possible, since there would be no IP versions to listen to.

chroot (default: #f)

Chroot into a separate directory to prevent access to other directories. This is to increase security in case there is a vulnerability in wsdd.

hop-limit (default: 1)

Limit to the level of hops for multicast packets. The default is 1 which should prevent packets from leaving the local network.

interface (default: '())

Limit to the given list of interfaces to listen to. By default wsdd will listen to all interfaces. Except the loopback interface is never used.

uuid-device (default: #f)

The WSD protocol requires a device to have a UUID. Set this to manually assign the service a UUID.

domain (default: #f)

Notify this host is a member of an Active Directory.

host-name (default: #f)

Manually set the hostname rather than letting wsdd inherit this host’s hostname. Only the host name part of a possible FQDN will be used in the default case.

preserve-case? (default: #f)

By default wsdd will convert the hostname in workgroup to all uppercase. The opposite is true for hostnames in domains. Setting this parameter will preserve case.

workgroup (default: "WORKGROUP")

Change the name of the workgroup. By default wsdd reports this host being member of a workgroup.


Next: Continuous Integration, Previous: Network File System, Up: Services   [Contents][Index]