Unix Technical Forum

LDAP client on 5.2

This is a discussion on LDAP client on 5.2 within the AIX Operating System forums, part of the Unix Operating Systems category; --> Hi. Always me! It's been months trying to use AIX as a client of our OpenLDAP servers without any ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-05-2008, 06:21 AM
Sensei
 
Posts: n/a
Default LDAP client on 5.2

Hi. Always me!

It's been months trying to use AIX as a client of our OpenLDAP servers
without any luck. Let me explain how my infrastructure works:

We have kerberos 5 on linux for authentication, openldap on linux for
user information (gecos, home dir, login shell...), openafs as a
distributed file system (don't bother about it).

Under linux, I just use openldap client and nss_ldap mapping uid, gid,
homedir and so on. Works like a charm on all 5 distros we use. It also
works under macosx, flawlessly. LDAP do NOT contain passwords, since I
use kerberos. And everything just works on these platforms.

AIX is the bad guy.

Note this:
- I can kinit, kadmin in AIX, so krb5.conf and keytab are ok.
- I can do ldapsearch -h HOST, *not* ldapsearch alone, since it still
contacts *localhost*! even if in /etc/security/ldap/ldap.cfg I set the
correct names.
- In /etc/security/user:
SYSTEM = "KRB5LDAP"
registry = "KRB5LDAP" (tried with LDAP also, but it doesn't work)
- In /lib/security/methods.cfg:
LDAP:
program = /lib/security/LDAP
KRB5LDAP:
program = /lib/security/KRB5A
options = authonly,db=LDAP,kadmind=no

Has anyone got aix working as a client of openldap? If so how? If I
can't use aix ldap, has anyone got openldap work as a client on aix? And
how to use a nssswitch in aix?
--
Sensei <mailto:senseiwa@tin.it> <pgp:8998A2DB>

The difference between stupidity and genius is that genius has its limits.
Albert Einstein
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-05-2008, 06:21 AM
Gary Tay Teng Teck
 
Posts: n/a
Default Re: LDAP client on 5.2

Sensei wrote:
> Hi. Always me!
>
> It's been months trying to use AIX as a client of our OpenLDAP servers
> without any luck. Let me explain how my infrastructure works:
>
> We have kerberos 5 on linux for authentication, openldap on linux for
> user information (gecos, home dir, login shell...), openafs as a
> distributed file system (don't bother about it).
>
> Under linux, I just use openldap client and nss_ldap mapping uid, gid,
> homedir and so on. Works like a charm on all 5 distros we use. It also
> works under macosx, flawlessly. LDAP do NOT contain passwords, since I
> use kerberos. And everything just works on these platforms.
>
> AIX is the bad guy.
>
> Note this:
> - I can kinit, kadmin in AIX, so krb5.conf and keytab are ok.
> - I can do ldapsearch -h HOST, *not* ldapsearch alone, since it still
> contacts *localhost*! even if in /etc/security/ldap/ldap.cfg I set the
> correct names.
> - In /etc/security/user:
> SYSTEM = "KRB5LDAP"
> registry = "KRB5LDAP" (tried with LDAP also, but it doesn't work)
> - In /lib/security/methods.cfg:
> LDAP:
> program = /lib/security/LDAP
> KRB5LDAP:
> program = /lib/security/KRB5A
> options = authonly,db=LDAP,kadmind=no
>
> Has anyone got aix working as a client of openldap? If so how? If I
> can't use aix ldap, has anyone got openldap work as a client on aix? And
> how to use a nssswitch in aix?


I don't have access to AIX enviroment, so if the below are incorrect
please treat them as rubbish. Sometimes back I had tried Kerberos (pw)
and LDAP (uid) with success on Solaris and RedHat, nowaday I have given
up using Kerberos as I think simple bind+TLS is good and simple enough.
Another reason is Kerberos pw is not CRYPT format, so migration of pw is
not possible.

The OpenLDAP LDAP Server should have been compiled with SASL/GSSAPI
support and its slapd.conf should have lines something like:

sasl-secprops noanonymous,noplain,noactive
saslRegexp uid=([^/]*),cn=GSSAPI,cn=auth uid=$1,ou=People,dc=example,dc=com
access to *
by dn="uid=[^/]+/admin,cn=GSSAPI,cn=auth" write
by * read

The above are taken from:
http://ofb.net/~jheiss/krbldap/howto.html

I also suggest you do not use IBM native ldap client, i,e, forget about
/etc/security/... and /lib/security/... config files , use PADL's
library and config files (/etc/ldap.conf and /etc/pam.conf) instead,
download and compile nss_ldap and pam_ldap (use AIX 5L 5.2 as it has
full PAM support).

Configure nss_ldap and pam_ldap, something like:

CC=gcc
MAKE=gmake
LDFLAGS="-L/opt/freeware/lib"
LIBS=-lc
CPPFLAGS="-I/opt/freeware/include -D_LINUX_SOURCE_COMPAT -DPAM_EXTERN="
../configure --with-ldap-lib=openldap \
--with-ldap-conf-file=/etc/ldap.conf \
--enable-configurable-krb5-ccname-env \
--enable-configurable-krb5-ccname-gssapi

After the Makefile is generated, modify it:

Add -L/opt/freeware/lib to the defintion of pam_ldap_so_LDFLAGS
Change all occurences of -g root to -g system
Copy exports.linux to exports.aix

The above are taken from:
http://www.redbooks.ibm.com/redbooks/pdfs/sg246622.pdf

You must modify the OpenLDAP slapd start script to pass "ldap" service
Kerberos keytab file, prior to running slapd.

===
# IMPORTANT: if you intend to use Kerberos for password authentication
# and LDAP for user id name service lookup, pls customize next line
KRB5_KTNAME="etc/openldap/ldap.keytab"; export KRB5_KTNAME
===

ldap service must be defined KDC:

(Assuming LDAP Server and Kerberos Server are on the same host)
kadmin:
* addprinc -randkey ldap/hostname
* ktadd -k /etc/openldap/ldap.keytab ldap/hostname

If you use OpenSSH, "host/hostname" service principal is needed, I think
AFS may also need one such, "afs/hostname"? read:

http://www.bayour.com/LDAPv3-HOWTO.html (Kerberos+LDAP+OpenAFS)

Assuming krb5.conf on client is set, you must compile a Kerberized
version of OpenSSH so that you could test a simple login like:

$ ssh -v gtay@sshclient
$ klist -e

(id taken from /etc/nsswitch.conf and /etc/ldap.conf, pw taken from
Kerberos)

Sample OpenSSH config step:
# ./configure --with-pam \
--sysconfdir=/etc/ssh --with-ssl-dir=/usr/local/ssl
--with-kerberos5=/usr/local

Sample sshd_config:
KerberosAuthentication yes
UsePAM yes

Sample /etc/pam.conf:
login auth sufficient pam_krb5.so.1
login auth required pam_unix.so.1 try_first_pass
other auth sufficient pam_krb5.so.1
other auth required pam_unix.so.1 try_first_pass
other account sufficient pam_krb5.so.1
other account required pam_unix.so.1
other session sufficient pam_krb5.so.1
other session required pam_unix.so.1
other password sufficient pam_krb5.so.1
other password required pam_unix.so.1 try_first_pass

Gary
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:21 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com