netapp设置没问题,在windows里访问也没问题
用代码smbfile来连接就一直报
jcifs.smb.SmbAuthException: Logon failure: unknown user name or bad password.
最后终于查到jcifs发的不是密码而是密码的某个哈希值
修改方法是
jcifs.Config.setProperty( "jcifs.smb.lmCompatibility", "2");
默认是3,netapp不支持
参考文章 https://communities.netapp.com/thread/24257
又查了一下这个配置
This client can perform NTLM and LMv2 authentication. The default behavior is to use NTLM version 1. This can be changed by using this property with an integer that specifies the "level" of security:
- 0,1 -- Sends LM and NTLM responses. This is the default behavior.
- 2 -- Sends only the NTLM response. This is more secure than Levels 0 and 1, because it eliminates the cryptographically-weak LM response.
- 3,4,5 -- Sends only the LMv2 response. This offers a higher level of security.
问题应该是NetApp用的是NTLM协议,而后改成0,1试了一下果然也没问题,最后还是改成更安全的2了