The Handbook

    Theme
    • Guides
        • Check a system before installing FreeBSD
        • Orient a Linux administrator on FreeBSD
        • Supported FreeBSD releases
        • Choose a FreeBSD documentation and support channel
        • Move files safely without GNU mv -t
        • Update, upgrade, or update packages?
        • Upgrade 14.4 or 15.0 to FreeBSD 15.1
        • Choose packages, ports, or poudriere
        • Choose the quarterly or latest package branch
        • Choose a FreeBSD download or package mirror
        • Make a system setting persistent
        • Configure locale, keyboard, and time zone
        • Configure a serial console for recovery
        • Choose a custom kernel, module, or loader setting
        • Run a Linux binary with the compatibility layer
        • Check desktop and laptop hardware before installation
        • Choose and check a graphics driver
        • Choose Xorg or Wayland
        • Build a maintainable desktop baseline
        • Install and check a desktop browser
        • Check laptop Wi-Fi, power, and suspend
        • Check multimedia readiness
        • Choose and configure a printing stack
        • Run Windows applications with Wine
        • Snapshot and replicate a ZFS dataset
        • Choose a filesystem and storage layout
        • Operate ZFS without losing the recovery path
        • Restore files from a ZFS snapshot
        • Read ZFS pool health and run a scrub
        • Replace a failed device in a ZFS mirror
        • Replicate a ZFS dataset over SSH
        • Change PF safely on a remote host
        • Configure a narrow WireGuard tunnel
        • Plan a FreeBSD home server
        • Choose a mail server or an outgoing relay
        • Publish a network service safely
        • Choose a jail network model
        • Choose native jails or a jail manager
        • Choose a jail or a bhyve virtual machine
        • Establish a FreeBSD security baseline
        • Choose a MAC policy
        • Audit security-relevant activity
        • Start a DTrace performance investigation
    • Integrations
        • Create a first jail with Bastille
        • Compare jail managers and OCI tooling
        • Publish a Bastille service through PF
        • Mount a ZFS dataset in a Bastille jail
        • Update and upgrade Bastille jails
        • Back up and restore a Bastille jail
        • Prepare bhyve and vm-bhyve
        • Choose NFS or Samba for file sharing
        • Choose ZFS backup automation
        • Operate a signed poudriere repository
        • Manage FreeBSD configuration with Ansible or Salt
        • Run Motion with webcamd on FreeBSD
        • Design a reverse proxy, certificates, and monitoring
    • FAQ
      • Troubleshooting
          • Recover an interrupted freebsd-update run
          • Resolve a package repository or ABI mismatch
          • Diagnose the FreeBSD boot path
          • Recover with a ZFS boot environment
          • Diagnose DNS, routing, and firewall paths
          • Diagnose network mbuf exhaustion
          • Bind a service to a low port without running it as root
          • Diagnose audio output or input
          • Diagnose webcamd, cuse, and a webcam
          • Fix USB device permissions without opening every device
      • About this handbook
      • Synopsis
      • Choose from client and identity requirements
      • Define a dedicated data boundary
      • Qualify an NFS export
      • Qualify a Samba share
      • Keep sharing separate from backup
      • Primary references

      Choose NFS or Samba for file sharing

      Last reviewed
      13 August 2026
      Applies to
      15.1-RELEASE, 15.0-RELEASE, 14.4-RELEASE

      Synopsis #

      NFS is a natural fit for trusted UNIX-like clients. A common NFS deployment using the default AUTH_SYS security flavor relies on coordinated numeric identities and a trusted network boundary; NFS can also use stronger identity and message-protection models. Samba provides SMB for Windows, macOS, and mixed-client environments and maintains its own authentication integration. Both expose filesystem data over a network and require a separate permission, firewall, backup, and recovery design.

      Neither protocol should be published directly to the public Internet. Use a trusted private network or an authenticated VPN boundary.

      Choose from client and identity requirements #

      RequirementNFSSamba
      Predominantly FreeBSD or UNIX-like clientsStrong fitPossible, but often unnecessary
      Native Windows client behaviorLimited fitStrong fit
      Coordinated numeric UID/GID ownershipCommon with AUTH_SYSCan map to local or directory identities
      Active Directory integrationNot its primary roleSupported by Samba, with substantial added complexity
      Small workgroup with named usersPossible with coordinated accountsCommon Samba role
      Public Internet exposureDo not use directlyDo not use directly

      Protocol selection does not override filesystem permissions. The service can only grant access that the underlying account and ACL model permit.

      Define a dedicated data boundary #

      Create or identify a dataset or filesystem specifically for the share. Record:

      • owner, group, mode, and ACL policy;
      • client identities and allowed networks;
      • read-only versus writable paths;
      • quota and capacity alert;
      • snapshot, replication, and restore policy;
      • whether applications also write the same files.

      Avoid exporting an entire pool, jail root, or home hierarchy merely because it is convenient. A narrow share is easier to authorize and restore.

      Qualify an NFS export #

      FreeBSD NFS exports are defined in /etc/exports. Each entry must identify the filesystem, options, and permitted clients. Omitting clients can allow any reachable client to mount the export, subject to the rest of the configuration.

      Begin with a read-only export to explicit hosts or a controlled network, reload the service, and inspect the effective export list from a client. With the default -sec=sys AUTH_SYS flavor, non-root users normally arrive as their client-supplied numeric credentials. Coordinate UID and GID values before allowing writes; matching names with different numeric IDs do not preserve ownership in that model.

      Where client-supplied numeric credentials are not an adequate identity boundary, evaluate NFSv4 with the Kerberos security flavors krb5, krb5i, or krb5p. The latter two add integrity protection or privacy as defined by the NFS security design. Current FreeBSD exports also support RPC-with-TLS controls, including certificate-based user mapping with -tlscertuser. Kerberos, TLS certificates, name services, and key lifecycle management are separate infrastructure commitments and should be designed before changing an export from AUTH_SYS.

      Use the current FreeBSD NFS documentation and exports(5) for the exact export form. Do not infer Linux /etc/exports options.

      Qualify a Samba share #

      Install Samba from one coherent package repository and create /usr/local/etc/smb4.conf from the current package and upstream documentation. A small workgroup server still needs explicit users, share paths, and authorization.

      Validate configuration before restarting:

      # testparm
      

      Begin with guest access disabled and one named test account. Verify read, create, rename, delete, and permission behavior from each supported client type before placing important data in the share.

      Samba versions and package origins change. Confirm the current package name and rc.d service on the installed release rather than preserving a versioned package name in long-lived automation.

      Keep sharing separate from backup #

      A mounted network share is an access path, not a backup. Client-side deletion, compromised credentials, and application damage can propagate to the server. Retain snapshots and an independent copy that share credentials cannot rewrite freely.

      See Plan a FreeBSD home server for service boundaries and Restore files from a ZFS snapshot for selective local recovery.

      Primary references #

      • FreeBSD Handbook: Network servers
      • FreeBSD Handbook: NFS
      • FreeBSD Handbook: Samba
      • exports(5)
      • nfsd(8)
      • Samba documentation

      Independent documentation. Not affiliated with or endorsed by the FreeBSD Project or the FreeBSD Foundation.

      Report a bug
      • Synopsis
      • Choose from client and identity requirements
      • Define a dedicated data boundary
      • Qualify an NFS export
      • Qualify a Samba share
      • Keep sharing separate from backup
      • Primary references