Skip to main content

SMB Client on macOS

Settings for the macOS smb client

  1. Create the file /etc/nsmb.conf file with the following content
[default]
streams=yes
notify_off=yes
soft=yes
port445=no_netbios
protocol_vers_map=46
mc_on=yes
mc_prefer_wired=yes
dir_cache_max_cnt=0
  1. In a terminal, execute sudo defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE. This disables the creation of .DS_Store files on network shares
  2. Restart the machine
  3. Reconnect all smb shares afterwards.

Details of the /etc/nsmb.conf settings

Setting Value Description
streams yes Enables support for NTFS alternate data streams, allowing macOS to read and write metadata and resource forks on SMB shares that support this feature [^1].
notify_off yes Disables file and directory change notifications from the server, which can reduce network traffic and prevent unnecessary refreshes in Finder [^4].
soft yes Configures soft mounts, meaning that if the server becomes unresponsive, operations will fail quickly instead of hanging indefinitely, improving user experience during network issues [^1].
port445 no_netbios Specifies that connections should use direct TCP on port 445 without falling back to NetBIOS over port 139, streamlining the connection process [^2].
protocol_vers_map 46 Sets the SMB protocol version compatibility bitmap; a6 valueto offorce 4SMB typically2 enablesor SMB23 while disabling older, less secure versions like SMB1only [^3].
mc_on yes Enables SMB Multichannel, allowing multiple connections between client and server to increase transfer speeds and provide redundancy [^7].
mc_prefer_wired yes When SMB Multichannel is enabled, this setting prioritizes wired network interfaces over Wi-Fi for better performance and stability [^5].
dir_cache_max_cnt 0 Disables local caching of directory listings, ensuring that you always see the most current files and folders on an SMB share [^6].

After modifying /etc/nsmb.conf, disconnect and reconnect any mounted SMB shares for the changes to take effect [^8].

[^1]: MacOS und SMB nerven | Das deutsche Synology Support Forum

[^2]: nsmb.conf(5) man page

[^3]: How to disable SMB 1 or NetBIOS in macOS

[^4]: DSM 7.2 - Dateien erscheinen nach dem Löschen wieder und lassen...

[^5]: Das Verhalten von SMB Multichannel konfigurieren - Apple Support (LI)

[^6]: Disable local SMB directory enumeration caching

[^7]: Configure SMB Multichannel behavior

[^8]: Apple macOS smbx and /etc/nsmb.conf information - GitHub