I want to map a large number of login usernames to a few unix users, so I guessed the username map config option is an appropriate way.
I enabled it for a particular share in smb.conf:
security = share [some_share] username_map = /etc/samba/some_share.map
and added all the usernames to the map:
some_share_user = anton berta caesar ...
But how do I set the passwords for those users?
# smbpasswd -a anton New SMB password: Retype new SMB password: Failed to add entry for user anton.
Though it doesn't say so explicitly, I guess this is because smbpasswd checks if there is a matching unix user and forgets to check all the username maps, too.