Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
In newer openldap versions the configuration is stored under the cn=config DIT and not in the /etc/openldap/slapd.conf file.
To setup a password for the admin user follow steps 2-4 here (written for Centos, but it's valid in general)
bdb_db_open: warning - no DB_CONFIG file found in directory /var/lib/ldap: (2).
Expect poor performance for suffix "dc=mydomain".
You didn't mention your diistro, but there should be a DB_CONFIG.example (or similar) file, that you need to copy into /var/lib/ldap, renaming it DB_CONFIG
Followed your guide and made settings for rootDN and root passwd.
I did another conversion :
Code:
[root@ldap1 openldap]# /usr/sbin/slaptest -f /etc/openldap/slapd.conf -v
bdb_db_open: DB_CONFIG for suffix "dc=mydomain" has changed.
Performing database recovery to activate new settings.
bdb_db_open: database "dc=mydomain": recovery skipped in read-only mode. Run manual recovery if errors are encountered.
bdb_monitor_db_open: monitoring disabled; configure monitor database to enable
config file testing succeeded
Then a search :
Code:
[root@ldap1 openldap]# ldapsearch -x -D 'cn=Manager,dc=mydomain' -b "dc=mydomain" -W
Enter LDAP Password:
# extended LDIF
#
# LDAPv3
# base <dc=mydomain> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#
# search result
search: 2
result: 32 No such object
# numResponses: 1
But as you see, my LDAP tree is still not existing.
In my original slapd.conf I have :
Code:
database bdb
suffix "dc=mydomain"
rootdn "cn=Manager,dc=mydomain"
rootpw {SSHA}tlhvb6SeOg9B4vzaOHV16Aos+yX3FvDB
access to attrs=userPassword
by * auth
access to dn="ou=contacten,ou=user8001,dc=mydomain" attrs=children
by group.exact="cn=admins,ou=user8001,dc=mydomain" write
by * none break
access to dn.one="ou=contacten,ou=user8001,dc=mydomain"
by group.exact="cn=admins,ou=user8001,dc=mydomain" write
by group.exact="cn=gebruikers,ou=user8001,dc=mydomain" read
access to dn.regex="ou=tbook[12345],ou=contacten,ou=user1001,dc=mydomain" attrs=children
by group.exact="cn=admins,ou=user1001,dc=mydomain" write
by * none break
access to dn.one="ou=tbook1,ou=contacten,ou=user1001,dc=mydomain"
by group.exact="cn=admins,ou=user1001,dc=mydomain" write
by group.exact="cn=tbook1,ou=gebruikers,ou=user1001,dc=mydomain" read
access to dn.one="ou=tbook2,ou=contacten,ou=user1001,dc=mydomain"
by group.exact="cn=admins,ou=user1001,dc=mydomain" write
by group.exact="cn=tbook2,ou=gebruikers,ou=user1001,dc=mydomain" read
access to dn.one="ou=tbook3,ou=contacten,ou=user1001,dc=mydomain"
by group.exact="cn=admins,ou=user1001,dc=mydomain" write
by group.exact="cn=tbook3,ou=gebruikers,ou=user1001,dc=mydomain" read
access to dn.one="ou=tbook4,ou=contacten,ou=user1001,dc=mydomain"
by group.exact="cn=admins,ou=user1001,dc=mydomain" write
by group.exact="cn=tbook4,ou=gebruikers,ou=user1001,dc=mydomain" read
access to dn.one="ou=tbook5,ou=contacten,ou=user1001,dc=mydomain"
by group.exact="cn=admins,ou=user1001,dc=mydomain" write
by group.exact="cn=tbook5,ou=gebruikers,ou=user1001,dc=mydomain" read
... and many more
To populate the LDAP with content, I know I can do it with a ldif file. Thanks.
But what about my access definitions ?
I have different subdomains, and I need to restrict access to each subdomain to only be accessible by the correct user.
This is what I mean (like I posted earlier) :
Code:
access to dn="ou=contacten,ou=user8001,dc=mydomain" attrs=children
by group.exact="cn=admins,ou=user8001,dc=mydomain" write
by * none break
access to dn.one="ou=contacten,ou=user8001,dc=mydomain"
by group.exact="cn=admins,ou=user8001,dc=mydomain" write
by group.exact="cn=gebruikers,ou=user8001,dc=mydomain" read
access to dn.regex="ou=tbook[12345],ou=contacten,ou=user1001,dc=mydomain" attrs=children
by group.exact="cn=admins,ou=user1001,dc=mydomain" write
by * none break
access to dn.one="ou=tbook1,ou=contacten,ou=user1001,dc=mydomain"
by group.exact="cn=admins,ou=user1001,dc=mydomain" write
by group.exact="cn=tbook1,ou=gebruikers,ou=user1001,dc=mydomain" read
access to dn.one="ou=tbook2,ou=contacten,ou=user1001,dc=mydomain"
by group.exact="cn=admins,ou=user1001,dc=mydomain" write
by group.exact="cn=tbook2,ou=gebruikers,ou=user1001,dc=mydomain" read
How can I import/convert these ? Because I have many of them...
I mean that you have to delete the slapd.d directory and recreate it with the command above.
Or you can change the slapd startup script to use /etc/openldap/slapd.conf and not /etc/openldap/slapd.d/ (i.e. the cn=config DIT)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.