Operating System - HP-UX
1819814 Members
4156 Online
109607 Solutions
New Discussion юеВ

Re: samba username mapping

 
SOLVED
Go to solution

samba username mapping

Hello,

I have a problem with user mapping in samba.
security = server to a Win NT domain.
this is working fine
we have the same UID├В┬┤s/account on unix as on windows,
but just a few people are registered as users on unix.
I want to preserve the usernames which are on both systems, and map the users just on the win domain to a special user on unix.

How can I configure the username.map to achieve this?

We are running samba 2.2.3a on a rp5470 for filetransfers between systems.

regards
Fra
sfra
8 REPLIES 8
RAC_1
Honored Contributor

Re: samba username mapping

Configuration file smb.conf has a parameter
mapfile = /tmp/mapfile.txt.

This just a text file and will have user name mappings from windows to unix users.

http://www.oreilly.com/catalog/samba/chapter/book/ch06.pdf

for details.
There is no substitute to HARDWORK

Re: samba username mapping

Hello RAC,

thanks for the link
I did try some combinations in the usermapping.
did not find a combination that is 1├В┬┤st looking if account is also a native unix account. it just ended up every time with the usermapping for the others.
It should not be a solution, where every unix account has to be mapped and serviced manually in the mapfile.

Fra
sfra
Geoff Wild
Honored Contributor

Re: samba username mapping

We use username mapping...

In /etc/opt/samba/username.map

unixid = ntuser1, ntuser2, ntuser3

That will map those nt users to the unix id.

Then in smb.conf:

username map = /etc/opt/samba/username.map

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Darren Prior
Honored Contributor

Re: samba username mapping

You can also specify groups as well as wildcards in the username map, see the O'Reilly Using Samba book or the smb.conf man page.

If you have a user on Windows that isn't on unix then you'll need to map that Windows user to some unix id - and that could involved a number of Windows users being mapped to one unix id (not great for determining file ownership) or a long list of names mapped from one to the other.

regards,

Darren.
Calm down. It's only ones and zeros...

Re: samba username mapping

my actual problem is, that I get all users mapped to my default user for people not registered with an unix account.

the mapping for this common user is OK, but this group overrides the native UID.

!%U = %u <- this is just a try that did not work
!sa000000 = sa00* <- the default map for just win users is OK

I get the unix users remapped to default user sa000000

regards
Franz
sfra

Re: samba username mapping

my real problem is, that also the unix users are remapped to the default user-ID sa000000.

I do not want their unix name remapped

!%U = %u <<<- is just a try and not working
!sa000000 = sa00* <<<- is OK, mapping to default

without usermapping the user-ID is OK, I get
SERVER\sa001234 for the correct unix user-id.
with usermap.conf I get SERVER\sa000000 which is the common(default) remapped user.

regards
Franz

sfra
Geoff Wild
Honored Contributor

Re: samba username mapping

For your real users, add them as well to username.map:

gwild = gwild
unixuser2 = unixuser2

etc..

That way they they won't get remapped.

If they need RW access to same share as the "common" user, then make sure they all belong to the same group and make the directory 660.


Rgds...Geoff







Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Darren Prior
Honored Contributor
Solution

Re: samba username mapping

I think Geoff's answer is the way forward, as the %U variable isn't always used by Samba.

This may not be a neat solution if you have to add a lot of users to the username map file.

regards,

Darren.
Calm down. It's only ones and zeros...