Samba AD as standard comes with the ability to add RFC2307 attributes to
a user or group (see here for more info:
https://www.ietf.org/rfc/rfc2307.txt)
What this means is, if you give a user a uidNumber and at least 'Domain
Users' a gidNumber, then the user will become visible on a Unix domain
member (aka Unix workstation).
If you study the list of attributes on the link above, you will find
that there are more attributes available, amongst them are loginShell
and homeDirectory. The first is where you can store the users login
shell (obviously), but there is a problem with the second, AD already
has an attribute with the same name to store the users windows home
directory path, so this became unixHomeDirectory and is where you can
store the users Unix home directory.
If you require more info on the RFC2307 attributes, please ask.
Now, as for the 'idmap config' block and which to use, this is down to
the sysadmin (i.e. you) and is based on what you require.
There are several backends available, but only two are regularly used,
the 'ad' and 'rid' backends. Lets deal with the 'rid' backend first,
this is used if you don't want (or need) to add RFC2307 attributes to
AD. Your users & groups will be mapped to a number inside the range you
set i.e. idmap config SAMDOM:range = 10000-99999. It uses an algorithm
to create the IDs from the user/group RID and as long as you use the
same 'idmap config' block on every Unix machine, you will get the same
Unix ID on every Unix machine. The downside is that you cannot set
individual homedirs & shells for users and will have to use the template
lines in smb.conf.
The 'ad' backend is different, it uses the RFC2307 attributes for the
user/group IDs, this does of course mean that you have to add a
uidNumber attribute containing a unique number to any users that you
need to be visible to Unix *and* add a gidNumber to Domain Users at
least. These numbers must be inside the range you set in smb.conf, any
numbers outside the range will be ignored.
You can go further with the 'ad' backend, you can add the loginShell
attribute containing the users shell (/bin/bash for instance), you can
also add the unixHomeDirectory attribute containing the path to the
users home directory. To use these, you would also need to have the line
'winbind nss info = rfc2307' in smb.conf. If you don't want to add these
further attributes, you can add 'winbind nss info = template' instead
and also add the template lines.
You need these lines in smb.conf:
idmap config *:backend = tdb
idmap config *:range = 2000-9999
These lines are where Samba will store the mappings for the builtin
users & groups, without these, it is very unlikely Samba will work
correctly.
Again, any questions, please ask.
Rowland