On OS X Lion, the preference is internally realized as two separate options:
/Library/Preferences/com.apple.AppleFileServer, it's the
guestAccess flag, and in
/Library/Preferences/SystemConfiguration/com.apple.smb.server.plist, it's the
To change these, execute the following with
defaults write /Library/Preferences/com.apple.AppleFileServer guestAccess -bool NO
defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server AllowGuestAccess -bool NO
Not sure if these are the same in previous versions of OS X. Use
defaults read <path> to find out if these options exist on your system.
You might need to relaunch the sharing service for the changes to take effect.