diff --git a/not-supported/smbserver.sh b/not-supported/smbserver.sh index f74db3ef..aed9a6a4 100644 --- a/not-supported/smbserver.sh +++ b/not-supported/smbserver.sh @@ -71,7 +71,7 @@ install_if_not samba install_if_not members # Use SMB3 -if ! grep -q "^protocol" /etc/samba/smb.conf +if ! grep -q "^protocol" "$SMB_CONF" then sed -i '/\[global\]/a protocol = SMB3' "$SMB_CONF" else @@ -86,6 +86,18 @@ else sed -i 's|.*access based share enum =.*|access based share enum = yes|' "$SMB_CONF" fi +# Activate encrypted transfer if AES-NI is enabled (passwords are encrypted by default) +install_if_not cpuid +if cpuid | grep " AES" | grep -q true +then + if ! grep -q "^smb encrypt =" "$SMB_CONF" + then + sed -i '/\[global\]/a smb encrypt = desired' "$SMB_CONF" + else + sed -i 's|^smb encrypt =.*|smb encrypt = desired|' "$SMB_CONF" + fi +fi + # Disable the [homes] share by default only if active if grep -q "^\[homes\]" "$SMB_CONF" then