Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

The document you linked to explicitly states

Please note that for user or share mode security, the username map is applied prior to validating the user credentials.

This means that you will have to set a shared password for some_share_user and make anton, berta, and caesar log in with that password.

It works exactly the opposite way if anton, berta, and caesar are users in a Windows domain. They will use their domain credentials to log in to your samba server. Then samba will map them to some_share_user.

share|improve this answer
    
In other words, it is not possible to have one common UNIX user but different passwords for different users. –  AndreKR Mar 28 '12 at 17:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.