Ik ben bezig met de installatie van een LDAP-server. So far so good volg ik even de tut van linux-scritps.nl want het staat daar allemaal nogal duidelijk uitgeled en dan weet je zeker wat je aan het doen bent 
NU zit ik alleen met dit stukje:
In de directory /etc/pam.d staat welke services op welke manier gebruik maken van pam. Hier onder een voorbeeld m.b.t. SSH
Zorg ervoor dat de /etc/pam.d/ssh file er als volgt uitziet:
ldap:/etc/pam.d# cat ssh
#%PAM-1.0
auth sufficient pam_unix_auth.so
auth required pam_ldap.so try_first_pass config=/etc/pam_ldap/ssh.conf
account sufficient pam_unix_acct.so
account required pam_ldap.so config=/etc/pam_ldap/ssh.conf
password sufficient pam_pwdb.so
password required pam_ldap.so use_first_pass config=/etc/pam_ldap/ssh.conf
session required pam_unix.so
Volgens deze configuratie worden eerst gekeken of een user lokaal bestaat, vervolgens in de LDAP server. Zoals je ziet heeft deze een aparte config file, zodat er aparte filters voor de verschillende services kunnen worden gedefinieerd. Maak ook deze config file aan:
cat /etc/pam_ldap/ssh.conf
# Your LDAP server.
host ldap.server.nl
# The distinguished name of the search base.
base o=test,c=nl
# Use the V3 protocol to optimize searches
ldap_version 3
#binddn cn=manager,o=test,c=nl
# The credentials to bind with.
# Optional: default is no credential.
#bindpw geheim
# Filter to AND with uid=%s
#Dit is het filter
#pam_filter service=*ssh*
# The user ID attribute (defaults to uid)
pam_login_attribute uid
# voeg deze regels toe voor gebruik over ssl
#port 636
#ssl yes
#tls_ciphers TLSv1
Enkele andere files:
ldap:/etc/pam.d# cat login
#%PAM-1.0
auth required /lib/security/pam_securetty.so
auth required /lib/security/pam_nologin.so
auth sufficient /lib/security/pam_ldap.so
auth required /lib/security/pam_unix_auth.so try_first_pass
account sufficient /lib/security/pam_ldap.so
account required /lib/security/pam_unix_acct.so
password required /lib/security/pam_cracklib.so
password required /lib/security/pam_ldap.so
password required /lib/security/pam_pwdb.so use_first_pass
session required /lib/security/pam_unix_session.so
ldap:/etc/pam.d# cat passwd
#%PAM-1.0
#voor unix
#password required pam_unix.so nullok obscure min=4 max=8 md5
#voor ldap
password required pam_ldap.so config=/etc/pam_ldap/passwd.conf
ldap:/etc/pam.d# cat /etc/pam_ldap/passwd.conf
# Your LDAP server.
host ldap.server.nl
#uri ldaps://ldap
port 389
#port 636
#ssl yes
# The distinguished name of the search base.
base o=test,c=nl
# Use the V3 protocol to optimize searches
#ldap_version 3
binddn cn=manager,o=test,c=nl
# The credentials to bind with.
# Optional: default is no credential.
bindpw geheim
# The user ID attribute (defaults to uid)
pam_login_attribute uid
#ssl on
De laatste 2 files aanmaken gaat niet. Ik doe iets fout maar kan nergens vinden wat. Ik ben van mening dat ik "ldap:/etc/pam.d# cat /etc/pam_ldap/passwd.conf" in de commandline moet zetten en er dan iets moet gaan gebeuren...... helaas gata wat mis en krijg deze error: -bash: ldap:/etc/pam.d#: No such file or directory
Wat gebeurd hier, wat doet de regel precies ? Hij maakt een file aan in de catogorie config ? Ik ben het spoor even bijster.
Nu is er nog een 2e probleem dat niet helemaal lekker gaat.
deze pagina: http://www.linux-scripts..../index.php?titel=8&stap=7 hier staat een test voor listening op poort 389 en 636. Als ik die testjes uitvoer krijg ik deze error:
ldap_start_tls: Can't contact LDAP server (-1)
Ik heb in de (linux)firewall en op de routers al de poorten open gezet om te kijken of dit uitmaakt...... het enige wat veranderde nar mijn weten was dat "ldap_start_tls" een andere melding was, wel iets met ldap.
Iemand een idee ? LDAP lijkt me namelijk wel helemaal geweldig
NU zit ik alleen met dit stukje:
In de directory /etc/pam.d staat welke services op welke manier gebruik maken van pam. Hier onder een voorbeeld m.b.t. SSH
Zorg ervoor dat de /etc/pam.d/ssh file er als volgt uitziet:
ldap:/etc/pam.d# cat ssh
#%PAM-1.0
auth sufficient pam_unix_auth.so
auth required pam_ldap.so try_first_pass config=/etc/pam_ldap/ssh.conf
account sufficient pam_unix_acct.so
account required pam_ldap.so config=/etc/pam_ldap/ssh.conf
password sufficient pam_pwdb.so
password required pam_ldap.so use_first_pass config=/etc/pam_ldap/ssh.conf
session required pam_unix.so
Volgens deze configuratie worden eerst gekeken of een user lokaal bestaat, vervolgens in de LDAP server. Zoals je ziet heeft deze een aparte config file, zodat er aparte filters voor de verschillende services kunnen worden gedefinieerd. Maak ook deze config file aan:
cat /etc/pam_ldap/ssh.conf
# Your LDAP server.
host ldap.server.nl
# The distinguished name of the search base.
base o=test,c=nl
# Use the V3 protocol to optimize searches
ldap_version 3
#binddn cn=manager,o=test,c=nl
# The credentials to bind with.
# Optional: default is no credential.
#bindpw geheim
# Filter to AND with uid=%s
#Dit is het filter
#pam_filter service=*ssh*
# The user ID attribute (defaults to uid)
pam_login_attribute uid
# voeg deze regels toe voor gebruik over ssl
#port 636
#ssl yes
#tls_ciphers TLSv1
Enkele andere files:
ldap:/etc/pam.d# cat login
#%PAM-1.0
auth required /lib/security/pam_securetty.so
auth required /lib/security/pam_nologin.so
auth sufficient /lib/security/pam_ldap.so
auth required /lib/security/pam_unix_auth.so try_first_pass
account sufficient /lib/security/pam_ldap.so
account required /lib/security/pam_unix_acct.so
password required /lib/security/pam_cracklib.so
password required /lib/security/pam_ldap.so
password required /lib/security/pam_pwdb.so use_first_pass
session required /lib/security/pam_unix_session.so
ldap:/etc/pam.d# cat passwd
#%PAM-1.0
#voor unix
#password required pam_unix.so nullok obscure min=4 max=8 md5
#voor ldap
password required pam_ldap.so config=/etc/pam_ldap/passwd.conf
ldap:/etc/pam.d# cat /etc/pam_ldap/passwd.conf
# Your LDAP server.
host ldap.server.nl
#uri ldaps://ldap
port 389
#port 636
#ssl yes
# The distinguished name of the search base.
base o=test,c=nl
# Use the V3 protocol to optimize searches
#ldap_version 3
binddn cn=manager,o=test,c=nl
# The credentials to bind with.
# Optional: default is no credential.
bindpw geheim
# The user ID attribute (defaults to uid)
pam_login_attribute uid
#ssl on
De laatste 2 files aanmaken gaat niet. Ik doe iets fout maar kan nergens vinden wat. Ik ben van mening dat ik "ldap:/etc/pam.d# cat /etc/pam_ldap/passwd.conf" in de commandline moet zetten en er dan iets moet gaan gebeuren...... helaas gata wat mis en krijg deze error: -bash: ldap:/etc/pam.d#: No such file or directory
Wat gebeurd hier, wat doet de regel precies ? Hij maakt een file aan in de catogorie config ? Ik ben het spoor even bijster.
Nu is er nog een 2e probleem dat niet helemaal lekker gaat.
deze pagina: http://www.linux-scripts..../index.php?titel=8&stap=7 hier staat een test voor listening op poort 389 en 636. Als ik die testjes uitvoer krijg ik deze error:
ldap_start_tls: Can't contact LDAP server (-1)
Ik heb in de (linux)firewall en op de routers al de poorten open gezet om te kijken of dit uitmaakt...... het enige wat veranderde nar mijn weten was dat "ldap_start_tls" een andere melding was, wel iets met ldap.
Iemand een idee ? LDAP lijkt me namelijk wel helemaal geweldig
Jij bent misschien belangrijk, maar ik ben aardig ;)