0

In organization we have setup ldap using openldap, i access it with GUI phpldapadmin.

we have one requirement to allow access some user from specific IPAddress.

I searched but still not able to get the exact solution.

example.ldif

dn: cn=xyz,ou=Person,dc=example,dc=com

cn: xyz

gidnumber: 570

homedirectory: /home/users/xyz

iphostnumber: 10.10.0.0

loginshell: /sbin/nologin

mail: xyz@example.com

objectclass: inetOrgPerson

objectclass: posixAccount

objectclass: top

objectclass: ipHost

postaladdress: 123xyz

sn: XYZ

uid: xyz

uidnumber: 1012

so we want xyz user should able to access openldap from iphostnumber: 10.10.0.0

2

You can do this by creating appropriate ACLs in your directory. Take a look at this forum thread in which the OP wants to have an IP address-based (and also filter based) access control to the directory. There are examples for IP-based ACLs which might help you. Perhaps, something like this:

access to *
       by peername.ip=10.10.0.0 read
       by * none

Of course, don't forget to read the OpenLDAP slapd.access manual.

  • Thanks...after reading slapd.access manual it is more clear how to do restriction on openldap. – Vinay Gupta May 24 '18 at 9:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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