在 Windows 中卸載並禁用 SMBv1

Jacki

最初的服務器消息塊 (SMB) 版本 1 (SMBv1) 協議已有近 30 年的歷史,與 80 年代開發的許多軟件一樣,它是為一個不再存在的世界而設計的。因此,SMBv1 協議存在重大安全漏洞,Microsoft 強烈建議您不要使用它。在本文中,您將了解如何在 Windows 中卸載和禁用 SMBv1。

SMBv1 代表服務器消息塊版本 1,由 Barry Feigenbaum 在 80 年代初創建,作為 DOS 的文件共享協議。 20 世紀 90 年代,Microsoft 開始在其操作系統中使用 SMBv1 作為共享對網絡上的文件、打印機和其他資源的訪問的協議。

SMBv1 協議使您組織的服務器/客戶端容易受到網絡攻擊。因此,立即停止使用這個已有 30 多年曆史的協議非常重要!

在 Windows 中獲取 SMBv1 狀態

檢查是否隨 PowerShell 安裝了 SMBv1 功能。

PS C:> Get-WindowsOptionalFeature -Online -FeatureName SMB1Protocol

FeatureName      : SMB1Protocol
DisplayName      : SMB 1.0/CIFS File Sharing Support
Description      : Support for the SMB 1.0/CIFS file sharing protocol, and the Computer Browser protocol.
RestartRequired  : Possible
State            : Enabled
CustomProperties :
                   ServerComponentDescription : Support for the SMB 1.0/CIFS file sharing protocol, and the Computer Browser protocol.
                   ServerComponentDisplayName : SMB 1.0/CIFS File Sharing Support
                   ServerComponentId : 487
                   ServerComponentType : Feature
                   ServerComponentUniqueName : FS-SMB1
                   ServerComponentDeploysUpdateName : SMB1Protocol

使用 PowerShell 檢查 SMBv1 協議狀態。

PS C:> Get-SmbServerConfiguration | Select EnableSMB1Protocol

EnableSMB1Protocol
------------------
              True

如何在 Windows 中卸載和禁用 SMBv1

非常重要的是你禁用解除安裝Windows 中的 SMBv1 協議。大多數管理員只執行其中一項任務,並認為這是正確的方法。不幸的是,事實並非如此,你必須兩者都做。

筆記:確保在 Windows 中禁用並卸載 SMBV1 協議。

1.禁用SMBv1協議

使用 PowerShell 禁用 SMBv1 協議

PS C:> Set-SmbServerConfiguration -EnableSMB1Protocol $false

驗證 SMBv1 協議是否已禁用。

更多閱讀:如何在 Windows 10 中卸載桌面應用程序和 Windows 應用程序

PS C:> Get-SmbServerConfiguration | Select EnableSMB1Protocol

EnableSMB1Protocol
------------------
             False

2.卸載SMBv1協議功能

使用 PowerShell 卸載 SMBv1 功能。

筆記:卸載SMBv1功能後需要重新啟動。

PS C:> Disable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol

檢查 SMBv1 功能是否已卸載。

PS C:> Get-WindowsOptionalFeature -Online -FeatureName SMB1Protocol

FeatureName      : SMB1Protocol
DisplayName      : SMB 1.0/CIFS File Sharing Support
Description      : Support for the SMB 1.0/CIFS file sharing protocol, and the Computer Browser protocol.
RestartRequired  : Possible
State            : Disabled
CustomProperties :
                   ServerComponentDescription : Support for the SMB 1.0/CIFS file sharing protocol, and the Computer Browser protocol.
                   ServerComponentDisplayName : SMB 1.0/CIFS File Sharing Support
                   ServerComponentId : 487
                   ServerComponentType : Feature
                   ServerComponentUniqueName : FS-SMB1
                   ServerComponentDeploysUpdateName : SMB1Protocol

您已成功關閉並禁用 SMBv1。

結論

您了解瞭如何在 Windows 中卸載和禁用 SMBv1。這可以是 Windows Server 或 Windows 客戶端。檢查狀態並確保 SMBv1 已關閉並禁用。假設您有許多 Windows 服務器和客戶端,推動此更改的一個很好的方法是通過 GPO。

您喜歡這篇文章嗎?您可能還喜歡在虛擬機上安裝 Windows Server。不要忘記關注我們並分享這篇文章。