smb LANMAN1 支持ntlm 0.12吗
经过测试与验证,先说结论,不需要LANMAN1就可以支持ntlm 0.12了.只需要NT1就可以支持ntlm 0.12了.
问题来源于小米盒子不能访问树莓派的smb服务,但是能访问打开了smbv1的windows共享服务.
修改后的树莓派的smb.conf配置如下:
[global]
client min protocol NT1
server min protocol NT1
使用testparam验证过,也没提示说配置有问题.
testparm
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Weak crypto is allowed
Server role: ROLE_STANDALONE
在小米盒子高清播放器里面访问树莓派时,提示不能连接,在树莓派里抓包
sudo tcpdump -i eth0 port 445 -w smb.pcap
结果如图所示:
Dialect: NT LM 0.12
Selected Index: -1, server does not support any of the listed dialects
感觉是不支持这个的意思了.
哪就用smbclient来验证一下了.
在树莓派上面安装smbclient工具
sudo apt install smbclient cifs-utils
smbclient -L 192.168.31.6 -m LANMAN1
lp_load_ex: Max protocol LANMAN1 is less than min protocol NT1.
protocol negotiation failed: NT_STATUS_INVALID_PARAMETER_MIX
smbclient -L 192.168.31.6 -m NT1
Enter WORKGROUPpi's password:
提示下面的输入密码就是正确的了.
如果是提示下面这样的,就说明samba的服务器server min protocol不匹配
smbclient -L 192.168.31.6 -m NT1
smbXcli_negprot_smb1_done: No compatible protocol selected by server.
protocol negotiation failed: NT_STATUS_INVALID_NETWORK_RESPONSE
正确的树莓派server min 配置如下:
[global]
client min protocol = NT1
server min protocol = NT1
修改参数的后重启
sudo systemctl restart smbd.service
当smbclient访问的时候,抓个包看看.
Dialect有NT LANMAN 1.0和NT LM 0.12了
连接成功的效果图
另外,要查看SMB本身支持哪些protocol
地址在这儿:https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html#CLIENTMAXPROTOCOL
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 later versions of Windows. SMB2 has sub protocols available.
SMB2_02: The earliest SMB2 version.
SMB2_10: Windows 7 SMB2 version.
By default SMB2 selects the SMB2_10 variant.
SMB3: The same as SMB2. Used by Windows 8. SMB3 has sub protocols available.
SMB3_00: Windows 8 SMB3 version.
SMB3_02: Windows 8.1 SMB3 version.
SMB3_11: Windows 10 SMB3 version.
By default SMB3 selects the SMB3_11 variant.
引用:
https://unix.stackexchange.com/questions/458203/available-min-max-values-for-smb-protocol
https://discussion.fedoraproject.org/t/samba-broken/82614/4
https://docs.redhat.com/zh-cn/documentation/red_hat_enterprise_linux/8/html/deploying_different_types_of_servers/assembly_using-the-smbclient-utility-to-access-an-smb-share_assembly_using-samba-as-a-server#proc_using-smbclient-in-interactive-mode_assembly_using-the-smbclient-utility-to-access-an-smb-share
https://blog.csdn.net/smstong/article/details/4977976
本文链接地址:https://const.net.cn/839.html