SMB unter MacOS beschleunigen
#!/bin/bash
# Prevent creation of .DS_Store files on network shares (neutral, improves performance)
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE
# Check if the nsmb.conf file exists and remove it if it does
if [ -f /private/etc/nsmb.conf ]; then
rm /private/etc/nsmb.conf
fi
echo '[default]' >> /etc/nsmb.conf
# Disable SMB signing (decreases security, improves speed)
echo "signing_required=no" >> /etc/nsmb.conf
# Disable negotiation validation (decreases security, improves speed)
echo "validate_neg_off=yes" >> /etc/nsmb.conf
# Enable support for named streams (neutral)
echo "streams=yes" >> /etc/nsmb.conf
# Disable change notifications (neutral)
echo "notify_off=yes" >> /etc/nsmb.conf
# Disable NetBIOS and use direct hosting over TCP/IP (improves security)
echo "port445=no_netbios" >> /etc/nsmb.conf
# Neutral
echo "unix extensions=no" >> /etc/nsmb.conf
# Neutral - prevents creation of hidden files
echo "veto files=/._*/.DS_Store/" >> /etc/nsmb.conf
# Block SMB1 connections - improves security
echo "protocol_vers_map=6" >> /etc/nsmb.conf
# Enable multi-channel support and prefer wired connections (neutral, typically safe)
echo "mc_on=yes" >> /etc/nsmb.conf
echo "mc_prefer_wired=yes" >> /etc/nsmb.conf