如何在Samba中强制执行SMB2协议?


Answers:


9

我对Nessus的测试表明,仅在设置时才禁用SMBv1

min protocol = SMB2

在smb.conf的[global]部分中。Core,LANMAN2和NT1仍被标记为易受攻击。


1
谢谢,这有所帮助。给其他人一个提示:配置文件smb.conf/etc/samba/Ubuntu 12上
。– ConvexMartian

4
对于将来的读者:这对服务器有效,因为min protocol“是”的同义词server min protocolsamba.org/samba/docs/man/manpages-3/…)。还有client min protocol,如果服务器仍支持SMB1,它可以帮助客户端避免使用SMB1。
扬d

1
不要忘了以后重启服务:CentOS 7 / RHEL 7 / Fedora Linux:$ sudo systemctl restart smb.service Debian 8.x / Ubuntu 16.04 LTS Linux:$ sudo systemctl restart smbd.service
Jack Wire

我收到错误,忽略参数“最小协议”的无效值“ SMB2”。我正在使用Samba 3.4.9
josircg

1
@josircg SMB2最初在3.6.0中得到支持
kbulgrien '18

5

我必须添加它才能使其在旧的 ubuntu 12服务器中工作;启用最小/最大组合中的任何一个SMBv1,但同时使用它们都可以。

[global]
min protocol = SMB2                                                                                 
max protocol = SMB2                                                                                 
client min protocol = SMB2
client max protocol = SMB2

1
不再提供与“ CentOS 6”配合使用的窗口。“您不能连接到文件共享,因为它不安全。”
尼尔

尝试从OSX High Sierra挂载时,这也起作用。仅使用min协议将不允许我连接。
user545424 '18

2

虽然我不确定SMB1的位置(我的猜测是CORE),但这是“ man smb.conf”中协议的顺序。

   max protocol (G)
       The value of the parameter (a string) is the highest protocol level that will be supported by the server.
       Possible values are :
       ·   CORE: Earliest version. No concept of user names.
       ·   COREPLUS: Slight improvements on CORE for efficiency.
       ·   LANMAN1: First
            modern version of the protocol. Long filename support.
       ·   LANMAN2: Updates to Lanman1 protocol.
       ·   NT1: Current up to date version of the protocol. Used by Windows NT. Known as CIFS.
       ·   SMB2: Re-implementation of the SMB protocol. Used by Windows Vista and newer.

   min protocol (G)
       The value of the parameter (a string) is the lowest SMB protocol dialect than Samba will support. Please refer to the max
       protocol parameter for a list of valid protocol names and a brief description of each. You may also wish to refer to the C
       source code in source/smbd/negprot.c for a listing of known protocol dialects supported by clients.
       If you are viewing this parameter as a security measure, you should also refer to the lanman auth parameter. Otherwise, you
       should never need to change this parameter.
       Default: min protocol = CORE
       Example: min protocol = NT1

1

我认为我在本[global]节中通过以下两行禁用了SMB1协议:

min protocol = LANMAN2
max protocol = SMB3

我还没有完全把握在桑巴协议的顺序,但我完全相信,LANMAN2是后SMB1


正如克里斯蒂安·M。指出的那样,这不是正确的答案。
斯曼

同意 因此,最好重新检查我的samba配置...
Avio

1

我认为您在smb.conf文件中寻找的是:

### 
服务器最小协议= SMB2_10
客户端最小协议= SMB2
客户端最大协议= SMB3
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.