http:///https:///api.php?action=feedcontributions&user=Fbm12&feedformat=atomSambaWiki - User contributions [en]2024-03-28T19:24:15ZUser contributionsMediaWiki 1.39.5https://wiki.samba.org/index.php?title=Ldapsam_Editposix&diff=1667Ldapsam Editposix2006-09-22T09:25:17Z<p>Fbm12: /* A quick setup */</p>
<hr />
<div>(First submitted by idra (a) samba.org)<br />
<br />
== Samba and the Editposix/Trusted Ldapsam extension ==<br />
<br />
The ldapsam:editposix extension is based on the ldapsam:trusted optimization.<br />
The ldapsam:trusted optimization has been developed as a performance optimization for server that uses ldap as user and group account storage. This optimization _requires_ that all users and groups posix account are saved on your ldap tree.<br />
<br />
<br />
The ldapsam:editposix extension has been created with the aim of making it easier to configure samba for use with an ldap server, by providing means to add the posix accounts and groups on the LDAP server without the need to use external scripts.<br />
<br />
To further help admins we introduced the <b>net sam provision</b> command that helps creating the basic accounts and groups need to make smbd run.<br />
<br />
A running winbind daemon is required to use ldapsam:editposix EVEN ON A SAMBA PDC.<br />
<br />
Using the ldap idmap backend is strongly advised too.<br />
<br />
== Basic LDAP configuration ==<br />
<br />
We will not get into the specific of LDAP configuration.<br />
To use editposix you need a very basic tree.<br />
<br />
Here it is an example base ldif to be loaded on your server<br />
to create the basic tree structure:<br />
<br />
<pre><br />
dn: dc=samba,dc=org<br />
objectClass: top<br />
objectClass: dcObject<br />
objectClass: organization<br />
o: samba.org<br />
dc: samba<br />
<br />
dn: cn=admin,dc=samba,dc=org<br />
objectClass: simpleSecurityObject<br />
objectClass: organizationalRole<br />
cn: admin<br />
description: LDAP administrator<br />
userPassword: secret<br />
<br />
dn: ou=users,dc=samba,dc=org<br />
objectClass: top<br />
objectClass: organizationalUnit<br />
ou: users<br />
<br />
dn: ou=groups,dc=samba,dc=org<br />
objectClass: top<br />
objectClass: organizationalUnit<br />
ou: groups<br />
<br />
dn: ou=idmap,dc=samba,dc=org<br />
objectClass: top<br />
objectClass: organizationalUnit<br />
ou: idmap<br />
<br />
dn: ou=computers,dc=samba,dc=org<br />
objectClass: top<br />
objectClass: organizationalUnit<br />
ou: computers<br />
</pre><br />
<br />
Download it _here_. (this is a place holder,<br />
is it possible to upload files on mediawiki ?)<br />
<br />
== Configuring smb.conf ==<br />
<br />
you need to properly configure smb.conf before running any daemon<br />
or command.<br />
<br />
Here is the bare minimum options to set in smb.conf:<br />
<br />
encrypt passwords = true<br />
passdb backend = ldapsam<br />
<br />
ldapsam:trusted=yes<br />
ldapsam:editposix=yes<br />
<br />
ldap admin dn = cn=admin,dc=samba,dc=org<br />
ldap delete dn = yes<br />
ldap group suffix = ou=groups<br />
ldap idmap suffix = ou=idmap<br />
ldap machine suffix = ou=computers<br />
ldap user suffix = ou=users<br />
ldap suffix = dc=samba,dc=org<br />
<br />
idmap backend = ldap:"ldap://localhost"<br />
<br />
idmap uid = 5000-50000<br />
idmap gid = 5000-50000<br />
<br />
<br />
== A quick setup ==<br />
<br />
Do not run any daemon until told, use a fresh install or<br />
wipe out any previously created tdb before starting.<br />
<br />
To quickly set up and test this feature follow these steps as root:<br />
<br />
Configure and run your ldap server, you may use the above base ldif<br />
as a starting point. Make sure the defined ldap admin works<br />
correctly.<br />
<br />
Configure smb.conf<br />
<br />
Add the ldap admin password to the samba secrets database:<br />
# smbpasswd -w secret<br />
<br />
Start winbindd only.<br />
# /etc/init.d/winbindd start<br />
<br />
provision the tree:<br />
# net sam provision<br />
<br />
Should the command returns:<br />
"Unable to allocate a new gid to create Domain Admins group"<br />
Raise the gidNumber and uidNumber range (for me worked 1000000-1100000)<br />
<br />
Give a password to the newly created Administrator user enabling it.<br />
# smbpasswd Administrator<br />
New SMB password:<br />
Retype new SMB password:<br />
<br />
Now start also nmbd and smbd:<br />
# /etc/init.d/nmbd start<br />
# /etc/init.d/smbd start<br />
<br />
Grant yourself some privileges:<br />
# net rpc rights grant Administrator SeAddUsersPrivilege -U Administrator<br />
# net rpc rights grant Administrator SeMachineAccountPrivilege -U Administrator<br />
<br />
== Managing your DB ==<br />
<br />
At this point you will be able to connect from any windows client or use any samba tool to manage your users groups and machines with the Administrator user.<br />
<br />
<br />
<br />
<br />
----<br />
[[Category:Category Configuration]]<br />
[[Category:Category Documentation]]</div>Fbm12