Windows usernames with spaces and Samba

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:

[global]
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.

4 Replies to “Windows usernames with spaces and Samba”

  1. i give ist a try, but on debian sarge as of jun 2006 is doesn’t work google said something like
    Note: to mount shares with spaces use “40” without the quotes in place of the … Example: mount -t cifs //server/share /mnt/samba -o username=username …
    gentoo-wiki.com/HOWTO_Setup_Samba – 45k –

    i will try that

  2. Another solution would be to have the idiotic micro$oft “managers” go back in time and undo the asinine idea to allow spaces in filenames, usernames, system accounts, etc. which was merely implemented for the novice idea of quote “readability’ – but breaks everything else often including native windoze functionality.

  3. Be nice if someone would come up with a safe, clean and effective way to remove the space in the Windows username completely. I changed the username in Windows but it made no difference because there are other places with it. I’m not keen on going through registry and “playing” around. Guess I’ll have to create an account and try.

Comments are closed.