However, this still uses a default domain name. I tried various values, like nil, \ etc. but none of them work. go-smb2 always prefixes the \ string with an additional \ so setting Domain to "\\" (remember to escape the \) results in a \\ in the login string. Samba's smbclient works for me.
I can verify this behaviour in Wireshark. Here are the relevant parts of the NTLMSSP_AUTH frames:
I need to login to a SMB server that requires a empty domain. By default, go-smb2 fetches a default domain name from the network. So I tried:
However, this still uses a default domain name. I tried various values, like
nil
,\
etc. but none of them work. go-smb2 always prefixes the\
string with an additional\
so setting Domain to"\\"
(remember to escape the\
) results in a\\
in the login string. Samba'ssmbclient
works for me.I can verify this behaviour in Wireshark. Here are the relevant parts of the
NTLMSSP_AUTH
frames:Samba:
\user
is used as full authentication string, access granted.go-smb2 (with
Domain: "\\"
):\\user
is used as full authentication string, access denied.It seems that there is no way to set an empty Domain in go-smb2.