如何讓 Samba 使用 SMBv2 版本

如何讓 Samba 使用 SMBv2 版本

近日來因為WannaCry勒索病毒的關系,大家開始對於SMB這名詞非常的有興趣,SMB為Server Message Block的縮寫,目的是對於機器與機器之間可以檔案與列印的分享,其中它的演進有許多的版本,這次會爆發的主因是微軟Windows作業系統普遍的使用這個通訊格式進行交換,但在實作驅動過程中因為設計上造成漏洞,而這漏洞又因為許多原因被有心人事取得並使用,造成漏洞為什麼現在才會被修補上,連微軟都破例替原本不再支援的Windows XP製作修補程式就知道市場方面,Windows XP還有存在的必要,在這要建議Windows使用者盡快升級至有支援系統更新維護的版本.

此篇目的要將Samba重新設定其SMB使用的版本,首先在你已經使用Samba的主機中篇輯設定檔,這裡使用的是nano編輯器:


nano /etc/samba/smb.conf

[Global]區段上新增最小支援的SMB版本


[global] : : min protocol = SMB2

修改後並儲存檔案,重新開啟Samba服務,目前的Linux全面改用Systemd管理程式,以它為例子:


systemctl restart smbd.service

或有些Linux分支使用:


systemctl restart smb.service

如此一來你使用的Samba就改用SMB2,至於目前使用SMB各版本的Windows作業系統列表:

  • CIFS – The ancient version of SMB that was part of Microsoft Windows NT 4.0 in 1996. SMB1 supersedes this version.
  • SMB 1.0 (or SMB1) – The version used in Windows 2000, Windows XP, Windows Server 2003 and Windows Server 2003 R2
  • SMB 2.0 (or SMB2) – The version used in Windows Vista (SP1 or later) and Windows Server 2008
  • SMB 2.1 (or SMB2.1) – The version used in Windows 7 and Windows Server 2008 R2
  • SMB 3.0 (or SMB3) – The version used in Windows 8 and Windows Server 2012
  • SMB 3.02 (or SMB3) – The version used in Windows 8.1 and Windows Server 2012 R2

以上資訊是從微軟網站所取得,傳送門在此。

參考資料