hierynomus / smbj

Server Message Block (SMB2, SMB3) implementation in Java
Other
718 stars 180 forks source link

use guest account connect to MacOs floder error #554

Closed zabio closed 3 years ago

zabio commented 4 years ago

Cannot require message signing when authenticating with a guest account

val client = SMBClient() client.connect("192.168.0.140").use { connection -> val ac = AuthenticationContext.guest() val session: Session = connection.authenticate(ac) (session.connectShare("share") as DiskShare?).use { val name = it?.smbPath?.path.noneNullStringValue() } }

tooptoop4 commented 3 years ago

SmbConfig config=SmbConfig.builder().withMultiProtocolNegotiate(true).withSigningRequired(false).build(); fixes this

hierynomus commented 3 years ago

Indeed, missed this issue, thanks for posting the solution @tooptoop4.

dkocher commented 1 year ago
2023-09-01 22:18:43,951 [Thread-110] DEBUG com.hierynomus.smbj.connection.SMBProtocolNegotiator - Negotiated the following connection settings: ConnectionContext{
  serverGuid=b1561070-edef-9450-9ecf-a3fd46de52b6,
  serverName='silverbullet.local',
  negotiatedProtocol=NegotiatedProtocol{dialect=SMB_3_0_2, maxTransactSize=4194304, maxReadSize=4194304, maxWriteSize=4194304},
  clientGuid=5207d5fe-024d-4c03-bcb3-151ad0b276d6,
  clientCapabilities=[SMB2_GLOBAL_CAP_DFS, SMB2_GLOBAL_CAP_LARGE_MTU],
  serverCapabilities=[SMB2_GLOBAL_CAP_LEASING, SMB2_GLOBAL_CAP_LARGE_MTU],
  clientSecurityMode=1,
  serverSecurityMode=3,
  server='com.hierynomus.smbj.server.Server@1740b4de'
}