Recently I had an issue where a windows user needed access to a samba share on a unix machine. The problem was that the windows user had a username with a space in it (tisk tisk) and unix/samba couldn’t directly support that. A quick workaround is to define a usermap in your smb.conf like so:
username map = /usr/local/private/usermap.txt
In the usermap.txt you define the username as follows:
username = “User Name”
Where username is the local unix username and “User Name” is the broken windows username with the space. It’s important to quote the username, otherwise samba will treat it as two different usernames. This isn’t the only use for samba usermaps but I was unable to find a well documented example of supporting windows usernames with spaces in them so hopefully this will save someone else time in the future.