Can’t Connect to Lion SMB Share?

I'd been having this problem for a while and decided to dig into it today. I have shares from a Lion box, but when I'd attempt to connect from Windows 7, it would just refuse my credentials.

Here's the solution that worked for me.

Edit this file in a text editor:

/Library/Preferences/SystemConfiguration/com.apple.smb.server.plist

You'll need permissions to edit it. Run your editor using sudo, for example.

Add the following keys:

[cc]
AllowKerberosAuth
AllowNTLM2Auth
KerberosRealm
***COPY-THE-LocalKerberosRealm-VALUE***
[/cc]

Don't forget to edit this to copy the LocalKerberosRealm value into the KerberosRealm value.

Once you've done this, save the file, turn SMB sharing off and back on, and you should be able to log in. I'm not convinced this is "the fix" for everybody, but it worked for me.