SSH mit AD (pam_ldap)

FreeBSD, Gentoo, openSUSE, CentOS, Ubuntu, Debian
schoeppchen
Posts: 27
Joined: 2006-06-11 09:51
 

SSH mit AD (pam_ldap)

Post by schoeppchen »

Hallo,

hat es hier jemand schon mal geschafft sich mit PAM-LDAP an einen WIndows 2003 AD Domänencontroller anzumelden um Credentials zu checken? Ich habe auf einem Debian-Sarge pam-ldap installiert.

Meine /etc/nsswitch.conf sieht so aus:

Code: Select all

passwd:         ldap compat
group:          ldap compat
shadow:         ldap compat
Meine /etc/pam.d/ssh sieht so aus:

Code: Select all

auth       required     pam_nologin.so
auth       required     pam_env.so # [1]
auth       sufficient   /lib/security/pam_ldap.so use_first_pass
@include common-auth

account  sufficient     /lib/security/pam_ldap.so
@include common-account

@include common-session
session    optional     pam_motd.so # [1]
session    optional     pam_mail.so standard noenv # [1]
session    required     pam_limits.so

password   required     /lib/security/pam_ldap.so
@include common-password
Meine /etc/pam_ldap.conf so:

Code: Select all

host 192.168.0.123
base CN=Users,DC=domain,DC=tld
uri ldap://192.168.0.123:389/CN=Users,DC=domain,DC=tld?sAMAccountName?sub?(objectclass=*)
ldap_version 3
binddn CN=ldapuser,CN=Users,DC=domain,DC=tld
bindpw secret
port 389
Evtl. sieht ja jemand direkt den Fehler (domain.tld heisst natürlich anders, ist aber korrekt gesetzt).
captaincrunch
Userprojekt
Userprojekt
Posts: 7066
Joined: 2002-10-09 14:30
Location: Dorsten
 

Re: SSH mit AD (pam_ldap)

Post by captaincrunch »

Wenn's dir "nur" um die Credentials geht, ist der Weg über krb5 erheblich einfacher. Das hatte ich irgendwann mal innerhalb von ein paar Minuten gebastelt.
DebianHowTo
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc
schoeppchen
Posts: 27
Joined: 2006-06-11 09:51
 

Re: SSH mit AD (pam_ldap)

Post by schoeppchen »

Ja, geht lediglich um User-/Passwort Abgleich mit AD. Werde mit Kerberos mal näher anschauen, oder hast du ein schnelles HOWTO parat?
flo
Posts: 2223
Joined: 2002-07-28 13:02
Location: Berlin
 

Re: SSH mit AD (pam_ldap)

Post by flo »

Ich benutze pam_winbind für imap und smtp - aber um die Kerberos-Sachen kommt man da auch nicht herum - es geht aber, wenn man es mal geschafft hat. - Toi, toi, toi ...

flo.
schoeppchen
Posts: 27
Joined: 2006-06-11 09:51
 

Re: SSH mit AD (pam_ldap)

Post by schoeppchen »

Hallo,

habe mich jetzt für die Umsetzung mittels Kerberos + Samba + Winbind entschieden. Das funktioniert prächtig und scheint mir stabil zu laufen.

Danke für die Tipps.