<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="http://okcomputer.antiflux.org/wiki/skins/common/feed.css?116"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://okcomputer.antiflux.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Using_LDAP_for_Authentication</id>
		<title>Using LDAP for Authentication - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://okcomputer.antiflux.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Using_LDAP_for_Authentication"/>
		<link rel="alternate" type="text/html" href="http://okcomputer.antiflux.org/wiki/index.php?title=Using_LDAP_for_Authentication&amp;action=history"/>
		<updated>2026-06-13T13:47:23Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.12.0</generator>

	<entry>
		<id>http://okcomputer.antiflux.org/wiki/index.php?title=Using_LDAP_for_Authentication&amp;diff=2918&amp;oldid=prev</id>
		<title>Tim at 20:01, 29 September 2007</title>
		<link rel="alternate" type="text/html" href="http://okcomputer.antiflux.org/wiki/index.php?title=Using_LDAP_for_Authentication&amp;diff=2918&amp;oldid=prev"/>
				<updated>2007-09-29T20:01:01Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 20:01, 29 September 2007&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 86:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 86:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;TLS_REQCERT     demand&amp;lt;br/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;TLS_REQCERT     demand&amp;lt;br/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Admin]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tim</name></author>	</entry>

	<entry>
		<id>http://okcomputer.antiflux.org/wiki/index.php?title=Using_LDAP_for_Authentication&amp;diff=2633&amp;oldid=prev</id>
		<title>Evan at 22:16, 15 May 2006</title>
		<link rel="alternate" type="text/html" href="http://okcomputer.antiflux.org/wiki/index.php?title=Using_LDAP_for_Authentication&amp;diff=2633&amp;oldid=prev"/>
				<updated>2006-05-15T22:16:35Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Migrating the User Database ==&lt;br /&gt;
&lt;br /&gt;
The migrationtools package will generate LDIF files based on information in /etc/shadow and /etc/passwd. The ldapadd command can be used to import these files into the database. The migrationtools utilities may include certain Kerberos-related attributes in the LDIF fields that slapd may not understand. These should be removed before importing the LDIF files, or else ldapadd will give an error.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /usr/share/migrationtools&amp;lt;br/&amp;gt;&lt;br /&gt;
./migrate_passwd.pl /etc/passwd | egrep -vi &amp;quot;krb|kerb&amp;quot; &amp;gt; /tmp/users.ldif&amp;lt;br/&amp;gt;&lt;br /&gt;
./migrate_group.pl /etc/group &amp;gt; /tmp/groups.ldif&amp;lt;br/&amp;gt;&lt;br /&gt;
ldapadd -D &amp;quot;cn=admin,dc=example,dc=com&amp;quot; -W -x -f /tmp/users.ldif&amp;lt;br/&amp;gt;&lt;br /&gt;
ldapadd -D &amp;quot;cn=admin,dc=example,dc=com&amp;quot; -W -x -f /tmp/groups.ldif&amp;lt;br/&amp;gt;&lt;br /&gt;
rm /tmp/groups.ldif /tmp/users.ldif&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LDAP and NSS ==&lt;br /&gt;
&lt;br /&gt;
To configure NSS to use LDAP for directory lookups, add the following to /etc/nsswitch.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
passwd:         ldap files&amp;lt;br/&amp;gt;&lt;br /&gt;
group:          ldap files&amp;lt;br/&amp;gt;&lt;br /&gt;
shadow:         ldap files&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== LDAP and PAM ==&lt;br /&gt;
&lt;br /&gt;
Add the following to /etc/pam_ldap.conf to tell the pam_ldap module how to access the user directory over LDAP. This assumes the LDAP server is on localhost.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
host 127.0.0.1&amp;lt;br/&amp;gt;&lt;br /&gt;
base ou=People,dc=example,dc=com&amp;lt;br/&amp;gt;&lt;br /&gt;
ldap_version 3&amp;lt;br/&amp;gt;&lt;br /&gt;
rootbinddn cn=admin,dc=example,dc=com&amp;lt;br/&amp;gt;&lt;br /&gt;
pam_password exop&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pam_password controls the hashing function used when changing passwords. The exop (extended operation) option is recommended, as then password are hashed using MD5 or SHA or whatever slapd is set up to use.&lt;br /&gt;
&lt;br /&gt;
Add the following to the common files in /etc/pam.d in order to configure PAM to use LDAP in conjunction with /etc/passwd and /etc/shadow. This setup assumes that users exist in both /etc/shadow|passwd and in the LDAP directory. It may not be appropriate when only system users (such as root) exist in /etc/passwd and regular users exist only in the LDAP directory.&lt;br /&gt;
&lt;br /&gt;
For /etc/pam.d/common-account:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
account [success=1 default=ignore] pam_ldap.so&amp;lt;br/&amp;gt;&lt;br /&gt;
account required pam_unix.so use_first_pass&amp;lt;br/&amp;gt;&lt;br /&gt;
account required pam_permit.so&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For /etc/pam.d/comment-auth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
auth [success=1 default=ignore] pam_ldap.so&amp;lt;br/&amp;gt;&lt;br /&gt;
auth required pam_unix.so try_first_pass&amp;lt;br/&amp;gt; &lt;br /&gt;
auth required pam_permit.so&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For /etc/pam.d/common-password:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
password required         pam_ldap.so ignore_unknown_user&amp;lt;br/&amp;gt;&lt;br /&gt;
password optional         pam_unix.so nullok obscure min=6 md5 try_first_pass&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LDAP and SSL ==&lt;br /&gt;
&lt;br /&gt;
Add the following to slapd.conf to configure slapd to use TLS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TLSCipherSuite HIGH:MEDIUM:+SSLv2&amp;lt;br/&amp;gt;&lt;br /&gt;
TLSCertificateFile /etc/ssl/certs/hostname.crt&amp;lt;br/&amp;gt;&lt;br /&gt;
TLSCertificateKeyFile /etc/ssl/private/hostname.key&amp;lt;br/&amp;gt;&lt;br /&gt;
TLSCACertificateFile /etc/ssl/CA/cacert.pem&amp;lt;br/&amp;gt;&lt;br /&gt;
TLSVerifyClient demand&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TLSCertificateFile contains the server certificate used by slapd. TLSCertificateKeyFile contains the server key. TLSCACertificateFile contains the CA certificate which signed both server and client certificates. TLSVerifyClient determines how forgiving slapd should be with clients who provide faulty certificates - demand is the strongest form of verification.&lt;br /&gt;
&lt;br /&gt;
You will also need to configure slapd to serve on port 636 (ldaps) as well as port 389 (ldap). Adding the following line to /etc/default/slapd will configure slapd to only listen on port 389 on localhost but accept connections on port 636 on all interfaces. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SLAPD_SERVICES=&amp;quot;ldap://127.0.0.1:389/ ldaps:///&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LDAP clients will need to know the location of the CA certificate file in order to verify the server's identity. Add the following to /etc/ldap/ldap.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
TLS_CACERT      /etc/ssl/antiflux/cacert.pem&amp;lt;br/&amp;gt;&lt;br /&gt;
TLS_REQCERT     demand&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Evan</name></author>	</entry>

	</feed>