<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>openldap &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/openldap/</link>
	<description>Feed of posts on WordPress.com tagged "openldap"</description>
	<pubDate>Sun, 29 Nov 2009 15:12:57 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Mandriva, servidores, nagios y otras hierbas]]></title>
<link>http://insanecrew.wordpress.com/2009/11/13/reflexiones-en-voz-alta/</link>
<pubDate>Fri, 13 Nov 2009 20:18:33 +0000</pubDate>
<dc:creator>bersuitvera</dc:creator>
<guid>http://insanecrew.wordpress.com/2009/11/13/reflexiones-en-voz-alta/</guid>
<description><![CDATA[Confieso que lo había olvidado, como dice el maestro Sinner:  LINUX es LINUX es LINUX es LINUX. Tant]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p style="text-align:justify;">Confieso que lo había olvidado, como dice el maestro Sinner:  LINUX es LINUX es LINUX es LINUX. Tanto tiempo escuchándolo en el trabajo, en la calle, en la red, incluso en <a href="http://www.blogdrake.net">Blogdrake</a> alguna vez: &#8220;<a href="http://www.mandriva.com">mandriva</a> es para el escritorio&#8221;,&#8221;en un server instala <a href="http://www.debian.org">Debian</a>/<a href="http://www.centos.org/">CentOS</a>/<a href="fedoraproject.org/es">Fedora</a>&#8220;,&#8221;mandriva es para  niñas&#8221;&#8230;  y un largo etc de muletillas.<br />
No me lo trago, mandriva me ha dado estupendos resultados como servidor últimamente en el trabajo.</p>
<p style="text-align:justify;"><strong><!--more-->El primer caso:</strong> un piloto para el montaje de un PDC con OpenLdap + Samba, antes de montarlo a &#8220;mano&#8221; me pidieron evaluar el ahora llamado <a href="http://directory.fedoraproject.org/">389-ds</a> y <a href="http://mds.mandriva.org/">Mandriva Directory Server</a>.  Evidentemente son versiones en continuo desarrollo, &#8220;embriones&#8221; para los productos de pago incluidos en Red Hat o en Mandriva Enterprise y no voy a negar que dan problemas. MDS vence por goleada, un producto serio, bien enfocado ( en mi opinión claro) usando herramientas ya conocidas y con una filosofía que va de la mano de la forma tradicional de montar un PDC con OpenLDAP+ SAMBA. 389-ds es todo lo contrario, van un poco &#8220;a su aire&#8221; por ser los herederos de antiguo NDS,  abandonan smbldaptools por unas nuevas &#8220;fdstools&#8221;, la integración con samba y postfix casi es &#8220;demoníaca&#8221; , todo esto con la versión estable para fedora 11 , si nos vamos a la versión testing simplemente no funciona.</p>
<p style="text-align:justify;"><strong>El segundo caso (ZAPE): </strong> Los pc&#8217;s de escritorio son cada vez  más baratos, más potentes y con más almacenamiento que muchos servidores &#8220;relativamente modernos&#8221; .  Una tarde me llaman del &#8220;otro trabajo&#8221;: &#8211; Oye Bersuit, que me sobra un equipo, me he equivocado con el pedido ¿ Que podemos hacer con él ?. Unas horas después estaba instalando Mandriva 2009 a un clónico con &#8220;nosecuantos&#8221; núcleos, varios gigas de RAM y 500 Gb de disco duro.  El servidor de almacenamiento/backup (ZIPI) con tropecientos gigas, raid 5 &#8220;chupi guay&#8221; va hasta el cuello y los discos valen una pasta. Con 100€ para comprar otro disco de respaldo ya tenemos un servidor de backup secundario.</p>
<p style="text-align:justify;">Mandriva 2009 + samba + winbind autenticándose contra el AD corporativo, almacena el repositorio de software, que liberó bastante espacio en el servidor primario,  almacena las copias antiguas de los servidores , las imágenes del pc de algún usuario, la segunda copia de los documentos &#8220;importantes&#8221; y las unidades para que los lusers guarden sus documentos que no quieren perder cuando llega &#8220;la cizalla&#8221; . Todas las noches poquito a poquito hace un rsync al segundo disco ( una controladora raid se salia del presupuesto), pero aún hay más &#8230;</p>
<p style="text-align:justify;"><a href="http://www.igniterealtime.org/projects/openfire/index.jsp">OpenFire</a> como servidor de IM interno autenticado también contra el AD, los usuarios al principio eran reticentes: ¡Bersuit yo quiero mi msn!, ahora ya no pueden vivir sin él.</p>
<p style="text-align:justify;">Ayer mismo me lleve la última sorpresa, que motiva esta entrada, instalando<a href="http://www.nagios.org"> nagios </a>para monitorizar los servicios dentro de la red interna:</p>
<blockquote><p>urpmi nagios nagios-www</p></blockquote>
<p style="text-align:justify;">Y ya, listo para hacer login en la consola web de nagios, ¡si hasta me había generado automáticamente un usuario y password ! listos que son estos chicos de mandriva si señor.</p>
<p style="text-align:justify;">Como conclusión: Linux es Linux es Linux es Linux,<strong> instala mandriva en tus servidores</strong>. Sí, es cierto, no hay que perder el norte, hay distribuciones &#8220;enterprise&#8221; que hacen las cosas muy bien, hay sitios donde entra una distribución de Linux suavemente y no es necesario &#8220;partirse&#8221;  la cara para meter tu distro preferida, pero no dejen a mandriva a un lado por ser una &#8220;distro de escritorio&#8221;.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Cara hapus seluruh data LDAP server]]></title>
<link>http://arifrohmanhakim.wordpress.com/2009/10/31/cara-hapus-seluruh-data-ldap-server-2/</link>
<pubDate>Sat, 31 Oct 2009 14:44:02 +0000</pubDate>
<dc:creator>arifrohman1</dc:creator>
<guid>http://arifrohmanhakim.wordpress.com/2009/10/31/cara-hapus-seluruh-data-ldap-server-2/</guid>
<description><![CDATA[Bisa install LDAP dan sudah lancar berjalan, akan tetapi diinginkan menghapus seluruh data LDAP dan ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Bisa install LDAP dan sudah lancar berjalan, akan tetapi diinginkan menghapus seluruh data LDAP dan akan dilakukan inisialisasi data dari awal kembali.</p>
<p>Langkahnya yaitu :</p>
<ol>
<li>Matikan service LDAP<br />
<blockquote><p>#service ldap stop</p></blockquote>
</li>
<li>Hapus database LDAPumunya database berada di /var/lib/ldap<br />
<blockquote><p># rm * -f</p></blockquote>
</li>
<li>Lakukan konfigurasi awal LDAP kembali</li>
</ol>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Cara hapus seluruh data LDAP server]]></title>
<link>http://arifrohmanhakim.wordpress.com/2009/10/31/cara-hapus-seluruh-data-ldap-server/</link>
<pubDate>Sat, 31 Oct 2009 13:59:50 +0000</pubDate>
<dc:creator>arifrohman1</dc:creator>
<guid>http://arifrohmanhakim.wordpress.com/2009/10/31/cara-hapus-seluruh-data-ldap-server/</guid>
<description><![CDATA[Bisa install LDAP dan sudah lancar berjalan, akan tetapi diinginkan menghapus seluruh data LDAP dan ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Bisa install LDAP dan sudah lancar berjalan, akan tetapi diinginkan menghapus seluruh data LDAP dan akan dilakukan inisialisasi data dari awal kembali.</p>
<p>Langkahnya yaitu :</p>
<ol>
<li>Matikan service LDAP<br />
<blockquote><p>#service ldap stop</p></blockquote>
</li>
<li>Hapus database LDAPumunya database berada di /var/lib/ldap<br />
<blockquote><p># rm * -f</p></blockquote>
</li>
<li>Lakukan konfigurasi awal LDAP kembali</li>
</ol>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Install LDAP server (plus phpLDAPadmin) di CENTOS]]></title>
<link>http://arifrohmanhakim.wordpress.com/2009/10/31/install-ldap-server-plus-phpldapadmin-di-centos/</link>
<pubDate>Sat, 31 Oct 2009 13:37:02 +0000</pubDate>
<dc:creator>arifrohman1</dc:creator>
<guid>http://arifrohmanhakim.wordpress.com/2009/10/31/install-ldap-server-plus-phpldapadmin-di-centos/</guid>
<description><![CDATA[LDAP atau Lightweight Directory Access Protocol adalah protokol aplikasi untuk melakukan query dan p]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>LDAP atau  Lightweight Directory Access Protocol adalah protokol aplikasi untuk melakukan query dan perubahan layanan direktori melalui TCP/IP. Sedangkan direktori disini yang dimaksud adalah sekumpulan obyek yang memiliki atribut yang secara logika maupun hirarki terorganisasi dengan baik. Sebagai contoh adalah direktori telpon yang berisi nama (orang maupun perusahaan) dikelompokkan secara alpabetis, dimana setiap nama memiliki alamat, no telpon dan lain-lain.</p>
<p>Pemanfaatan lain LDAP ini biasanya dipakai untuk melaukan layanan otentifikasi, terkait dengan permasalahan keamanan seperti jaringan komputer, sistem informasi, dll.</p>
<p><!--more--></p>
<p>Cara instalasi di CENTOS  yaitu :</p>
<p>1. Jalankan terminal<br />
2. install openldap</p>
<p>#yum install openldap openldap-client openldap-server</p>
<p>3. Konfigurasi ldapserver,<br />
Buat LDAP root user password</p>
<p>#slappasswd<br />
New password:                         —&#62; misalnya masukkan 123456 sebagai password<br />
Re-enter new password:<br />
{SSHA}+7NhMdrO/CU1ToxihSPH74/NpQNBMh5h</p>
<p>4. Ubah setup slapd.conf, yang BOLD yang saya ubah</p>
<p>#vi /etc/openldap/slapd.conf#</p>
<p># See slapd.conf(5) for details on configuration options.<br />
# This file should NOT be world readable.<br />
#<br />
include         /etc/openldap/schema/core.schema<br />
include         /etc/openldap/schema/cosine.schema<br />
include         /etc/openldap/schema/inetorgperson.schema<br />
include         /etc/openldap/schema/nis.schema</p>
<p># Allow LDAPv2 client connections.  This is NOT the default.<br />
allow bind_v2</p>
<p># Do not enable referrals until AFTER you have a working directory<br />
# service AND an understanding of referrals.<br />
#referral       ldap://root.openldap.org</p>
<p>pidfile         /var/run/openldap/slapd.pid<br />
argsfile        /var/run/openldap/slapd.args</p>
<p># Load dynamic backend modules:<br />
# modulepath    /usr/lib/openldap<br />
# moduleload    back_bdb.la<br />
# moduleload    back_ldap.la<br />
# moduleload    back_ldbm.la<br />
# moduleload    back_passwd.la<br />
# moduleload    back_shell.la</p>
<p># The next three lines allow use of TLS for encrypting connections using a<br />
# dummy test certificate which you can generate by changing to<br />
# /etc/pki/tls/certs, running “make slapd.pem”, and fixing permissions on<br />
# slapd.pem so that the ldap user or group can read it.  Your client software<br />
# may balk at self-signed certificates, however.<br />
# pastikan dahulu letak folder file berikut, gunakan perintah  #find / -name ‘ca-bundle.crt’</p>
<p>TLSCACertificateFile /etc/pki/tls/certs/ca-bundle.crt<br />
TLSCertificateFile /etc/pki/tls/certs/slapd.pem<br />
TLSCertificateKeyFile /etc/pki/tls/certs/slapd.pem</p>
<p># Sample security restrictions<br />
#       Require integrity protection (prevent hijacking)<br />
#       Require 112-bit (3DES or better) encryption for updates<br />
#       Require 63-bit encryption for simple bind<br />
# security ssf=1 update_ssf=112 simple_bind=64</p>
<p># Sample access control policy:<br />
#       Root DSE: allow anyone to read it<br />
#       Subschema (sub)entry DSE: allow anyone to read it<br />
#       Other DSEs:<br />
#               Allow self write access<br />
#               Allow authenticated users read access<br />
#               Allow anonymous users to authenticate<br />
#       Directives needed to implement policy:<br />
# access to dn.base=”&#8221; by * read<br />
# access to dn.base=”cn=Subschema” by * read<br />
# access to *<br />
#       by self write<br />
#       by users read<br />
#       by anonymous auth</p>
<p>access to * by * read</p>
<p># if no access controls are present, the default policy<br />
# allows anyone and everyone to read anything but restricts<br />
# updates to rootdn.  (e.g., “access to * by * read”)<br />
#<br />
# rootdn can always read and write EVERYTHING!</p>
<p>#######################################################################<br />
# ldbm and/or bdb database definitions<br />
#######################################################################</p>
<p>database        bdb<br />
suffix          “dc=arifrohman,dc=com”<br />
rootdn          “cn=admin,dc=arifrohman,dc=com”<br />
# Cleartext passwords, especially for the rootdn, should<br />
# be avoided.  See slappasswd(8) and slapd.conf(5) for details.<br />
# Use of strong authentication encouraged.<br />
# rootpw                123456<br />
rootpw          {SSHA}+7NhMdrO/CU1ToxihSPH74/NpQNBMh5h</p>
<p># The database directory MUST exist prior to running slapd AND<br />
# should only be accessible by the slapd and slap tools.<br />
# Mode 700 recommended.<br />
directory       /var/lib/ldap<br />
loglevel 256<br />
lastmod on<br />
schemacheck on<br />
cachesize 100000</p>
<p># Indices to maintain for this database<br />
index objectClass                       eq,pres<br />
index ou,cn,mail,surname,givenname      eq,pres,sub<br />
index uidNumber,gidNumber,loginShell    eq,pres<br />
index uid,memberUid                     eq,pres,sub<br />
index nisMapName,nisMapEntry            eq,pres,sub</p>
<p># Replicas of this database<br />
#replogfile /var/lib/ldap/openldap-master-replog<br />
#replica host=ldap-1.example.com:389 starttls=critical<br />
#     bindmethod=sasl saslmech=GSSAPI<br />
#     authcId=host/ldap-master.example.com@EXAMPLE.COM</p>
<p>5. Copy file konfigurasi database LDAP</p>
<p># cp /etc/openldap/DB_CONFIG.example /var/lib/ldap/DB_CONFIG</p>
<p>6. Jalankan LDAP server</p>
<p># service ldap start</p>
<p>7. setup LDAP agar otomatis start saat Centos booting</p>
<p># chkconfig –level 235 ldap on</p>
<p>8. Inisialisasi LDAP root</p>
<p># vi ldap_root.ldif</p>
<p>isikan dengan data berikut :</p>
<p>dn: dc=arifrohman,dc=com<br />
dc: arifrohman<br />
description: LDAP Admin<br />
objectClass: dcObject<br />
objectClass: organizationalUnit<br />
ou: rootobject<br />
dn: ou=People, dc=arifrohman,dc=com<br />
ou: People<br />
description: Users of UII<br />
objectClass: organizationalUnit</p>
<p>tambahkan data ke servel ldap, dengan perintah berikut :</p>
<p># ldapadd -x -D “cn=Manager,dc=arifrohman,dc=com” -W -f ldap_root.ldif</p>
<p>9. install web server untuk manajemen ldap server</p>
<p># yum install httpd php-mbstring php-ldap</p>
<p>10. Download phpldapadmin dari website http://phpldapadmin.sourceforge.net/download.php, cari versi yang terakhir</p>
<p>#wget http://internode.dl.sourceforge.net/sourceforge/phpldapadmin/phpldapadmin-1.1.0.5.zip</p>
<p>11. install phpldapadmin sebagai halaman utama dari webserver di /var/www/html</p>
<p>#unzip phpldapadmin-1.1.0.5.zip -d /var/www/<br />
#cp /var/www/phpldapadmin-1.1.0 /var/www/html -R</p>
<p>12. konfigurasi phpLDAPadmin</p>
<p>#cp /var/www/htm/config.php.example /var/www/html/config/config.php<br />
#vi /var/www/html/config/config.php</p>
<p>lakukan editing bagian server agar terhubung ke server ldap:</p>
<p>/*********************************************/<br />
/* Define your LDAP servers in this section  */<br />
/*********************************************/</p>
<p>$i=0;<br />
$ldapservers = new LDAPServers;</p>
<p>/* A convenient name that will appear in the tree viewer and throughout<br />
phpLDAPadmin to identify this LDAP server to users. */<br />
$ldapservers-&#62;SetValue($i,’server’,&#8217;name’,&#8217;UII LDAP Server’);</p>
<p>/* Examples:<br />
‘ldap.example.com’,<br />
‘ldaps://ldap.example.com/’,<br />
‘ldapi://%2fusr%local%2fvar%2frun%2fldapi’<br />
(Unix socket at /usr/local/var/run/ldap) */<br />
$ldapservers-&#62;SetValue($i,’server’,&#8217;host’,&#8217;127.0.0.1′);</p>
<p>/* The port your LDAP server listens on (no quotes). 389 is standard. */<br />
$ldapservers-&#62;SetValue($i,’server’,&#8217;port’,&#8217;389′);</p>
<p>/* Array of base DNs of your LDAP server. Leave this blank to have phpLDAPadmin<br />
auto-detect it for you. */<br />
// $ldapservers-&#62;SetValue($i,’server’,&#8217;base’,array(”));</p>
<p>/* Four options for auth_type:<br />
1. ‘cookie’: you will login via a web form, and a client-side cookie will<br />
store your login dn and password.<br />
2. ’session’: same as cookie but your login dn and password are stored on the<br />
web server in a persistent session variable.<br />
3. ‘http’: same as session but your login dn and password are retrieved via<br />
HTTP authentication.<br />
4. ‘config’: specify your login dn and password here in this config file. No<br />
login will be required to use phpLDAPadmin for this server.</p>
<p>Choose wisely to protect your authentication information appropriately for<br />
your situation. If you choose ‘cookie’, your cookie contents will be<br />
encrypted using blowfish and the secret your specify above as<br />
session['blowfish']. */<br />
$ldapservers-&#62;SetValue($i,’server’,&#8217;auth_type’,&#8217;cookie’);</p>
<p>/* The DN of the user for phpLDAPadmin to bind with. For anonymous binds or<br />
‘cookie’ or ’session’ auth_types, LEAVE THE LOGIN_DN AND LOGIN_PASS BLANK. If<br />
you specify a login_attr in conjunction with a cookie or session auth_type,<br />
then you can also specify the login_dn/login_pass here for searching the<br />
directory for users (ie, if your LDAP server does not allow anonymous binds. */<br />
$ldapservers-&#62;SetValue($i,’login’,&#8217;dn’,&#8217;cn=Manager,dc=uii,dc=ac,dc=id’);<br />
#  $ldapservers-&#62;SetValue($i,’login’,&#8217;dn’,&#8217;cn=Manager,dc=example,dc=com’);</p>
<p>/* Your LDAP password. If you specified an empty login_dn above, this MUST also<br />
be blank. */<br />
$ldapservers-&#62;SetValue($i,’login’,&#8217;pass’,”);<br />
#  $ldapservers-&#62;SetValue($i,’login’,&#8217;pass’,’secret’);</p>
<p>/* Use TLS (Transport Layer Security) to connect to the LDAP server. */<br />
$ldapservers-&#62;SetValue($i,’server’,&#8217;tls’,false);</p>
<p>13. Tes dengan browser</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Openfire, Asterisk Interagindo Voip com Seus Clientes Internos]]></title>
<link>http://diegograssato.wordpress.com/2009/10/28/openfire-asterisk-interagindo-voip-com-seus-clientes-internos/</link>
<pubDate>Wed, 28 Oct 2009 14:41:55 +0000</pubDate>
<dc:creator>DIEGO PEREIRA GRASSATO</dc:creator>
<guid>http://diegograssato.wordpress.com/2009/10/28/openfire-asterisk-interagindo-voip-com-seus-clientes-internos/</guid>
<description><![CDATA[&nbsp; &nbsp; &nbsp; &nbsp; O Openfire é um servidor Jabber desenvolvido em Java pela Ignite Realtim]]></description>
<content:encoded><![CDATA[&nbsp; &nbsp; &nbsp; &nbsp; O Openfire é um servidor Jabber desenvolvido em Java pela Ignite Realtim]]></content:encoded>
</item>
<item>
<title><![CDATA[OpenLdap: Study Guide Integration with Sendmail,Postfix,Apache &amp; Samba]]></title>
<link>http://kiranjith.wordpress.com/2009/10/19/openldap-study-guide-integration-with-sendmailpostfixapache-samba/</link>
<pubDate>Mon, 19 Oct 2009 06:08:00 +0000</pubDate>
<dc:creator>kiranjith</dc:creator>
<guid>http://kiranjith.wordpress.com/2009/10/19/openldap-study-guide-integration-with-sendmailpostfixapache-samba/</guid>
<description><![CDATA[http://www.rootkit.nl/files/book_lpic-3_301.html]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>
<div class="MsoNormal"><a href="http://www.rootkit.nl/files/book_lpic-3_301.html">http://www.rootkit.nl/files/book_lpic-3_301.html</a></div>
<p></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[OpenLDAP - Diretório para as Massas]]></title>
<link>http://strikermdd.wordpress.com/2009/09/29/openldap-diretorio-para-as-massas/</link>
<pubDate>Tue, 29 Sep 2009 15:40:02 +0000</pubDate>
<dc:creator>Bruno</dc:creator>
<guid>http://strikermdd.wordpress.com/2009/09/29/openldap-diretorio-para-as-massas/</guid>
<description><![CDATA[Você ainda utiliza autenticação individual para cada serviço ? Seus usuários já estão cansados de me]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Você ainda utiliza autenticação individual para cada serviço ? Seus usuários já estão cansados de memorizar tantas senhas ?</p>
<p>Realmente tudo isso simplesmente não pode existir em ambientes organizados, empresas com mais de 50 funcionários já não podem mais se dar ao luxo de fazerem as coisas &#8220;&#8216;de qualquer jeito&#8221;. Utilizando-se um ambiente com autenticação centralizada todos saem ganhando, tanto os Administradores de Rede, Programadores ou os próprios usuários, todos usufruem das facilidades de um serviço de Autenticação Centralizada.</p>
<p>Daí entra em campo o <strong>OpenLDAP</strong>, um serviço de Diretórios OpenSource baseado no protocolo<strong> LDAP</strong> que usa o modelo <strong>X.500</strong>, utilizado principalmente para autenticação centralizada de serviços. Onde um Diretório é uma estrutura de armazenamento organizado de forma hirárquica, que facilita o armazenamento e busca por informações.</p>
<p>Apesar de se parecer bastante com o conceito de um Banco de Dados, uma Base <strong>LDAP</strong> não é recomendada para situações onde há grande volume de escrita, e sim quando é necessário um grande volume de consultas a informações como logins, que é onde o<strong> OPENLDAP</strong> se destaca por sua velocidade e compatibilidade com centenas de aplicações. Permitindo assim um ambiente homogêneo de autenticação e consulta de informações simples.</p>
<p><img class="aligncenter size-full wp-image-30" title="OpenLDAP-logo" src="http://strikermdd.wordpress.com/files/2009/09/openldap-logo.png" alt="OpenLDAP-logo" width="305" height="120" /></p>
<p><strong>Instalando o OpenLDAP :</strong></p>
<p><em><strong>Debian-like :</strong></em></p>
<blockquote><address><em>$ apt-get install slapd ldap-utils libnss-ldap libpam-ldap</em></address>
</blockquote>
<p><strong>OBS. :</strong> Durante a instalação do libnss-ldap serão efetuadas algumas perguntas, mas basicamente a maioria você irá deixar como padrão, as únicas coisas que mudam são o endereço do ldap ( <em>127.0.0.1</em> ) e o caminho da Base ( <em>dc=base,dc=com,dc=br</em> ).</p>
<p><em><strong>Red-hat-like :</strong></em></p>
<blockquote><address><em>$ yum install openldap openldap-servers openldap-servers-overlays</em></address>
</blockquote>
<p><strong>Criando uma Senha para o Administrador da Base :</strong></p>
<blockquote><address>$<em> ldappasswd -h {MD5}</em><strong> </strong></address>
</blockquote>
<p>Será gerada uma senha em <strong>MD5</strong> como essa : &#8220;<em>{MD5}W6whSnp02Fl3rPMXH3wijw==&#8221;  copie o resultado e cole-o no campo </em><em><span style="font-size:10pt;font-family:courier new,courier;">rootpw.<br />
</span></em></p>
<p><strong>Arquivo de Configurações de Exemplo :</strong></p>
<p><strong>OBS. :</strong> Esse arquivo deve ser seguido apenas como exemplo, e alterado de acordo com as necessidades do ambiente a ser implementado, principalmente em produção. Tomando em considerações questões como volume de informações armazenadas e a segurança de acesso.<br />
<em><strong>slapd.conf :</strong></em></p>
<blockquote><p><em><span style="font-size:10pt;font-family:courier new,courier;"># Versão de Protocolo para consultas ao LDAP</span> &#8211; Não recomendado por ser antigo e inseguro<br />
<span style="font-size:10pt;font-family:courier new,courier;">#allow bind_v2</span><br />
<span style="font-size:10pt;font-family:courier new,courier;"> </span><br />
<span style="font-size:10pt;font-family:courier new,courier;"> # Schemas</span> / Altere os caminhos para os REDHAT like.<br />
<span style="font-size:10pt;font-family:courier new,courier;"> include        /etc/ldap/schema/core.schema</span><br />
<span style="font-size:10pt;font-family:courier new,courier;"> include        /etc/ldap/schema/cosine.schema</span><br />
<span style="font-size:10pt;font-family:courier new,courier;"> include        /etc/ldap/schema/nis.schema</span><br />
<span style="font-size:10pt;font-family:courier new,courier;"> include        /etc/ldap/schema/inetorgperson.schema</span><br />
<span style="font-size:10pt;font-family:courier new,courier;"> </span><br />
<span style="font-size:10pt;font-family:courier new,courier;"> # Arquivos de controle dos processos</span><br />
<span style="font-size:10pt;font-family:courier new,courier;"> pidfile        /var/run/slapd/slapd.pid</span><br />
<span style="font-size:10pt;font-family:courier new,courier;"> argsfile    /var/run/slapd/slapd.args</span><br />
<span style="font-size:10pt;font-family:courier new,courier;"> </span><br />
<span style="font-size:10pt;font-family:courier new,courier;"> # Módulos<br />
# No Fedora/RedHat você deve comentar<br />
# as duas linhas abaixo</span><br />
<span style="font-size:10pt;font-family:courier new,courier;"> modulepath    /usr/lib/ldap</span><br />
<span style="font-size:10pt;font-family:courier new,courier;"> moduleload    back_hdb</span><br />
<span style="font-size:10pt;font-family:courier new,courier;"><br />
# Controle de acesso<br />
# acesso à estrutura básica do Diretório<br />
access to dn.exact=&#8221;"<br />
</span><span style="font-size:10pt;font-family:courier new,courier;"> </span><span style="font-size:10pt;font-family:courier new,courier;"> </span><span style="font-size:10pt;font-family:courier new,courier;"> </span><span style="font-size:10pt;font-family:courier new,courier;"> </span><span style="font-size:10pt;font-family:courier new,courier;"> by * read</span></em></p>
<p><em># Apenas o próprio usuário pode ver/alterar a senha<br />
access to attrs=userPassword<br />
by self write<br />
by anonymous auth<br />
by * none</em></p>
<p><em># Libera consulta a todos os outros dados de nossa base<br />
access to *<br />
by * read</em></p>
<p><span style="font-size:10pt;font-family:courier new,courier;"><em> # Definição do nível de log</em></span><em><br />
<span style="font-size:10pt;font-family:courier new,courier;"> loglevel 0</span><br />
<span style="font-size:10pt;font-family:courier new,courier;"> </span></em></p>
<p><em><span style="font-size:10pt;font-family:courier new,courier;"> # Base de dados</span><span style="font-size:10pt;font-family:courier new,courier;"><br />
backend hdb<br />
database    hdb</span><br />
<span style="font-size:10pt;font-family:courier new,courier;"> </span><br />
<span style="font-size:10pt;font-family:courier new,courier;"> # Estrutura do diretório e administrador</span><br />
<span style="font-size:10pt;font-family:courier new,courier;"> suffix        &#8220;dc=base,dc=com,dc=br&#8221;</span><br />
<span style="font-size:10pt;font-family:courier new,courier;"> rootdn        &#8220;cn=root,dc=base,dc=com,dc=br&#8221;<br />
# A senha a seguir é um exemplo<strong> </strong>e deve ser substituída pela sua saída do comando<strong> </strong>slappasswd</span> -h {MD5}<br />
<span style="font-size:10pt;font-family:courier new,courier;"> rootpw </span>{MD5}W6whSnp02Fl3rPMXH3wijw==<br />
<span style="font-size:10pt;font-family:courier new,courier;"> </span><br />
<span style="font-size:10pt;font-family:courier new,courier;"> # Local de armazenamento dos dados</span><br />
<span style="font-size:10pt;font-family:courier new,courier;"> directory    /var/lib/ldap</span><br />
<span style="font-size:10pt;font-family:courier new,courier;"> </span><br />
<span style="font-size:10pt;font-family:courier new,courier;"> # Índices de pesquisa</span><br />
<span style="font-size:10pt;font-family:courier new,courier;"> index    objectClass    eq</span><br />
<span style="font-size:10pt;font-family:courier new,courier;">index    cn,sn,mail     eq,sub,approx<br />
index    uid            eq,sub</span></em></p></blockquote>
<p><strong>Populando a base :</strong><br />
Salve o conteúdo abaixo em um arquivo chamado <em>ldap-base.ldif </em>(<strong> ldif</strong> é o formato de texto utilizado pelo <strong>Openldap</strong> para lidar com inclusões, alterações e remoções de uma base ldap via linha de comando. )</p>
<p><em><strong>ldap-base.ldif</strong></em> :</p>
<blockquote><p><em>dn: dc=base,dc=com,dc=br<br />
dc: base<br />
objectClass: top<br />
objectClass: domain</em></p>
<p><em>dn: ou=Pessoas,dc=base,dc=com,dc=br<br />
ou: Pessoas<br />
objectClass: top<br />
objectClass: organizationalUnit</em></p>
<p><em>dn: ou=Grupos,dc=base,dc=com,dc=br<br />
ou: Grupos<br />
objectClass: top<br />
objectClass: organizationalUnit</em></p>
<p><em>dn: ou=Computadores,dc=base,dc=com,dc=br<br />
ou: Computadores<br />
objectClass: top<br />
objectClass: organizationalUnit</em></p>
<address><em>dn: cn=suporte,ou=Pessoas,dc=base,dc=com,dc=br<br />
objectClass: top<br />
objectClass: person<br />
cn: nssuser<br />
sn: Usuario de Suporte para testes</em><br />
</address>
</blockquote>
<p><strong>Incluindo os dados na base : </strong></p>
<blockquote><address>$<em> ldapadd -f ldap-base.ldif -x -D &#8220;cn=root,dc=base,dc=com,dc=br&#8221; -W</em></address>
</blockquote>
<p>Pronto! Caso nenhum erro ocorra sua base está populada e funcional, caso contrário, pare o serviço do ldap e remova todos os arquivos do diretório <em>/var/lib/ldap</em> e comece tudo novamente.</p>
<p><strong>Autenticando-se ao LDAP :</strong></p>
<p><em><strong>RedHat like :</strong></em><br />
rode o comando &#8220;<em>setup</em>&#8221; na linha de comando, escolha a opção <em>Autenticação</em>, e depois marque as opções  ldap na primeira coluna e  MD5, Ldap e Autenticação Local é Suficiente, depois avance e digite o endereço de sua base ( no caso local ) &#8220;<em>127.0.0.1</em>&#8221; e a base &#8220;<em>dc=base,dc=com,dc=br</em>&#8221; e depois avance novamente e saia da caixa do Setup.</p>
<p><em><strong>Debian Like :</strong></em></p>
<blockquote><address><em>$ apt-get install libpam-ldap libnss-ldap nss-updatedb</em></address>
</blockquote>
<p><strong><em>C</em>rie um arquivo chamado &#8220;<em>auth_ldap</em>&#8220;  com o conteúdo abaixo e salve-o no diretório &#8220;<em>/etc/auth-client-config/profile.d</em>&#8220;  :</strong></p>
<blockquote><p><em>[auth_ldap]<br />
nss_passwd=passwd: compat ldap<br />
nss_group=group: compat ldap<br />
nss_shadow=shadow: compat ldap<br />
nss_netgroup=netgroup: nis<br />
pam_auth=auth       required     pam_env.so<br />
auth       sufficient   pam_unix.so likeauth nullok<br />
auth       required   pam_mount.so use_first_pass<br />
auth       sufficient   pam_ldap.so use_first_pass<br />
auth       required     pam_deny.so<br />
pam_account=account    sufficient   pam_unix.so<br />
account    sufficient   pam_ldap.so<br />
account    required     pam_deny.so<br />
pam_password=password   required     pam_unix.so nullok obscure min=4 max=8 md<br />
password   sufficient   pam_ldap.so use_first_pass<br />
pam_session=session    required     pam_limits.so<br />
session    required     pam_mkhomedir.so skel=/etc/skel/<br />
session    required     pam_unix.so<br />
session    optional     pam_ldap.so<br />
session    optional     pam_mount.so</em></p></blockquote>
<p><strong>Agora execute o seguinte comando para efetuar as alterações no sistema para que o mesmo comece a se autenticar via ldap :</strong></p>
<blockquote><address><em>$ auth-client-config -a -p auth_ldap</em></address>
</blockquote>
<p><strong>Testando se as informações estão sendo armazenadas na base ldap :</strong></p>
<blockquote><address><em>$ ldapsearch -x</em></address>
</blockquote>
<p><strong>O retorno do comando acima deve ser semelhante ao visto abaixo :</strong></p>
<blockquote><address><em>dn: dc=base,dc=com,dc=br</em></address>
<address></address>
<address><em>objectClass: top </em></address>
<address><em><br />
</em></address>
<address><em>dn: ou=Pessoas,dc=base,dc=com,dc=br</em><br />
objectClass: top<br />
objectClass: organizationalunit<br />
ou: Pessoas<em> </em></address>
<address> </address>
<address><em>dn: ou=Grupos,dc=base,dc=com,dc=br</em></address>
<address>objectClass: top</address>
<address>objectClass: organizationalunit</address>
<address>ou: Grupos</address>
<address><em>dn: ou=Computadores,dc=base,dc=com,dc=br</em><br />
objectClass: top<br />
objectClass: organizationalunit<br />
ou: Computadores</p>
</address>
<address><em>dn: uid=suporte,ou=Pessoas,dc=base,dc=com,dc=br</em></address>
<address><em>objectClass: person </em></address>
<address><em>objectClass: top </em></address>
<address><em>objectClass: organizationalPerson </em></address>
<address><em>ou: Accounting </em></address>
<address><em>ou: Pessoas</em></address>
<address><em>sn: Suporte</em></address>
</blockquote>
<p><strong>Ferramentas Recomendadas :</strong></p>
<ul>
<li><a title="Apache Directory Studio" href="http://directory.apache.org/studio/" target="_self"><strong>Apache Directory Studio</strong></a> &#8211; Excelente ferramenta desktop multiplataforma feita em java e baseada no Eclipse para Gerenciamento de Bases LDAP.</li>
</ul>
<ul>
<li><a title="GOSA" href="https://oss.gonicus.de/labs/gosa/" target="_self"><strong>GOSA</strong></a> &#8211;  Ferramenta de Gerenciamento de Bases <strong>LDAP</strong> via Web.</li>
</ul>
<p><strong><br />
Outros Serviços de Diretórios Semelhantes :</strong></p>
<ul>
<li><strong> <a title="Fedora Directory Server" href="http://directory.fedoraproject.org/" target="_self">Fedora Directory Server</a></strong></li>
<li><a title="Centos Directory Server" href="http://www.google.com.br/url?sa=t&#38;source=web&#38;ct=res&#38;cd=1&#38;url=http%3A%2F%2Fwiki.centos.org%2FHowTos%2FDirectoryServerSetup&#38;ei=0ibCSq2FMIaruAePsuXJBQ&#38;usg=AFQjCNF3gHKBiMBIebAFKcWfqySbZ9bUMQ&#38;sig2=txIv_rm6gUENZW6pKKI2yA" target="_self"><strong>Centos Directory Server</strong></a></li>
<li><a title="RedHat Directory Server" href="http://www.br.redhat.com/products/infrastructure/directory_server/" target="_self"><strong>RedHat Directory Server</strong></a></li>
<li><a title="Apache Directory Server" href="http://directory.apache.org/" target="_self"><strong>Apache Directory Server</strong></a></li>
</ul>
<p>Pronto ! Agora temos uma base ldap rodando e esperando apenas ser organizada como devido e populada. Em próximos artigos irei citar integrações como Serviços como Samba, Squid, etc.</p>
<p>Espero que tenha sido de ajuda para aqueles que possam estar quebrando a cabeça como eu estava a alguns anos atrás heheh.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Rhcss institute in jaipur]]></title>
<link>http://grras.wordpress.com/2009/09/07/rhcss-institute-in-jaipur/</link>
<pubDate>Mon, 07 Sep 2009 16:51:40 +0000</pubDate>
<dc:creator>Grras</dc:creator>
<guid>http://grras.wordpress.com/2009/09/07/rhcss-institute-in-jaipur/</guid>
<description><![CDATA[GRRAS – An apex center for promotion and development of Linux operating system operating for imparti]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><div class="top_banners_left"><a href="http://www.grras.com/"><img src="http://www.grras.com/wp-content/themes/default/images/grras_logo.jpg" width="265" height="129" border="0" /></a></div>
<p>GRRAS – An apex center for promotion and development of Linux operating system operating for imparting education on Linux, open source and open source-based value-added applications. We are the partner of Rajasthan Knowledge Corporation limited. We strive to spread awareness in people about computer with this program and promote IT in every area in Rajasthan. </p>
<p>GRRAS has been training the corporate houses and students Linux technologies like RHCE, <a href="http://www.grras.com/">RHCSS</a>, System &#38; network administration, SELINUX, Firewall security, Shell Scripting. For a very long time we have been engaged in offering foremost Linux related training courses which is tremendously lucrative for the IT organizations &#38; Students involved in Software Development, System &#38; Network Administration, SELinux &#38; Firewall security.</p>
<p>contact detail&#8211;</p>
<p>219, Himmat Nagar,Behind Kiran Sweets,<br />
Gopalpura Turn, Tonk Road, Jaipur(Raj.)<br />
Tel: +91-141-3136868, +91- 9887789124, +91-9352767438<br />
Email: <a title="info@grras.com " href="info@grras.com " target="_blank">info@grras.com</a><br />
<strong><a title="Website Source" href="http://www.grras.com/" target="_blank"><b>RHCE Certification</b></a></strong></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Red Hat Certified Security Specialist (RHCSS) in jaipur]]></title>
<link>http://rhcsstrainingcentre.wordpress.com/2009/08/30/red-hat-certified-security-specialist-rhcss-in-jaipur/</link>
<pubDate>Sun, 30 Aug 2009 12:18:54 +0000</pubDate>
<dc:creator>Grras</dc:creator>
<guid>http://rhcsstrainingcentre.wordpress.com/2009/08/30/red-hat-certified-security-specialist-rhcss-in-jaipur/</guid>
<description><![CDATA[Red Hat Certified Security Specialist (RHCSS) is a security certification that proves advanced skill]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a title="Red Hat Certified Security Specialist (RHCSS) in jaipur" href="http://www.grras.com/" target="_blank"><img class="aligncenter size-full wp-image-5" title="inoffice - Copy" src="http://rhcsstrainingcentre.wordpress.com/files/2009/08/inoffice-copy.jpg" alt="inoffice - Copy" width="450" height="252" /></a></p>
<p>Red Hat Certified Security Specialist (RHCSS) is a security certification that proves advanced skills in using Red Hat Enterprise Linux, SELinux, and Red Hat Directory Server to meet the security requirements of today&#8217;s enterprise environment.</p>
<p>join GRRAS institute for Red Hat Certified Security Specialist (RHCSS) and Red Hat Certified Engineer (RHCE).</p>
<p>* GRRAS is the only institute in jaipur(India) which has first network and security specialists.<br />
* It’s an admiration to be a part of an institute which has best Linux professionals.<br />
* All the GRRAS faculties are technocrats and have much experience of Linux teaching.<br />
* GRRAS provides doubt solving sessions which tend to effective training.<br />
* We became the renowned leader and did set the benchmark for the IT market in training of Linux since the very beginning of our foundation.<br />
* We empower our Linux trainees with unique core competencies for exploiting the untouched jobs in Linux field.</p>
<p>Administering Linux 2.6.x (particularly Red Hat). Installation, initial configuration, using the bash command shell, managing files, managing software, and granting rights to users. DNS, FTP, Apache, send mail, Samba, and other services are covered with live training and full dedication.</p>
<p>Advantage of the COURSE</p>
<p>The Linux Networking &#38; System Administration course provides knowledge and skills for Linux- and/or UNIX- systems administrators who want to build proficiency at configuring common network services and security administration using Linux. This course is updated for building skills on Linux Administration.</p>
<p>you can contact for Red Hat Certified Security Specialist (RHCSS) and Red Hat Certified Engineer (RHCE) batches.</p>
<p>contact detail&#8211;<br />
219, Himmat Nagar,Behind Kiran Sweets,<br />
Gopalpura Turn, Tonk Road, Jaipur(Raj.)<br />
Tel: +91-141-3136868, +91- 9887789124, +91-9352767438<br />
Email: <a title="info@grras.com" href="info@grras.com " target="_blank">info@grras.com</a><br />
<a title="Website Source" href="http://www.grras.com" target="_blank"><strong><br />
</strong></a></p>
<h1><a title="Website Source" href="http://www.grras.com" target="_blank"><strong>Website Source</strong></a></h1>
<p><a title="Website Source" href="http://www.grras.com" target="_blank"><strong> </strong></a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Changing the Alfresco LDAP Group Identifier]]></title>
<link>http://raygauss.wordpress.com/2009/08/22/changing-the-alfresco-ldap-group-identifier/</link>
<pubDate>Sat, 22 Aug 2009 15:29:14 +0000</pubDate>
<dc:creator>rgauss</dc:creator>
<guid>http://raygauss.wordpress.com/2009/08/22/changing-the-alfresco-ldap-group-identifier/</guid>
<description><![CDATA[We were originally using Apple OS X Server as our LDAP store for our Alfresco instance. Apple&#8217;]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>We were originally using Apple OS X Server as our LDAP store for our <a href="http://alfresco.com" target="_blank">Alfresco</a> instance.</p>
<p><a href="http://www.apple.com/server/macosx/" target="_blank">Apple&#8217;s OS X Server</a> uses <a href="http://www.openldap.org/" target="_blank">OpenLDAP</a> but adds custom schema for many things including users and groups.  As a result we ended up using the <strong><code>description</code></strong> LDAP attribute for Alfresco&#8217;s <code>ldap.synchronisation.groupIdAttributeName</code>.</p>
<p>We&#8217;ve since migrated to a generic OpenLDAP server (with a bit of our own custom schema) so we&#8217;re now able to use the more common and unchanging <strong><code>cn</code></strong> attribute for the group id.</p>
<p>When we change <code>ldap.synchronisation.groupIdAttributeName</code> in <code>ldap-synchronisation.properties</code> Alfresco imports the new groups properly but group permissions on spaces will retain the old group name so we need to change those to use the new <strong><code>cn</code></strong> attribute.</p>
<p>What we did was to create a temporary table in the Alfresco database, import the mapping of the <strong><code>cn</code></strong> attribute to the <strong><code>description</code></strong> attribute, then run a query to replace the old authorities with the new.</p>
<p>The following assumes Alfresco version 3.x.</p>
<h3>Create the Temp Table</h3>
<div style="background-color:#C5E4F7;border:thin dashed gray;margin:20px;padding:5px 20px;"><code>CREATE TABLE  alfresco.t_ldap_groups (<br />
`dn` VARCHAR( 255 ) NULL ,<br />
`cn` VARCHAR( 255 ) NULL ,<br />
`description` VARCHAR( 255 ) NULL<br />
);</code></div>
<h3>Import the LDAP Group Data</h3>
<p>We used <a href="http://phpldapadmin.sourceforge.net/">phpLDAPAdmin</a> to export our groups subtree as CSV with only the <strong><code>cn</code></strong> and <strong><code>description</code></strong> attributes, then imported that file into the <code> t_ldap_groups</code> table just created.</p>
<h3>Replace the Old Authorities</h3>
<p>I&#8217;m by no means an SQL expert but the query below does the following:</p>
<ul>
<li>Strips <code>GROUP_</code> from the current stored group long name</li>
<li>Searches the temporary LDAP table for that group long name and corresponding group short name</li>
<li>Updates the <strong><code>alf_authority.authority</code></strong> field with <code>GROUP_<em>group short name</em></code></li>
</ul>
<div style="background-color:#C5E4F7;border:thin dashed gray;margin:20px;padding:5px 20px;"><code>UPDATE alf_authority<br />
SET authority = CONCAT('GROUP_',<br />
(SELECT cn FROM t_ldap_groups WHERE description =    SUBSTRING(alf_authority.authority, 7) LIMIT 1))<br />
WHERE authority LIKE 'GROUP_%' AND<br />
(SELECT cn FROM t_ldap_groups WHERE description =    SUBSTRING(alf_authority.authority, 7) LIMIT 1) IS NOT NULL;<br />
</code></div>
<p>In Alfresco 2.x the authority is stored directly in the <code> alf_access_control_entry</code> table as well so the update statement would be a bit more complicated.</p>
<h3>Drop the Temp Table</h3>
<p><code>DROP TABLE t_ldap_groups;</code></p>
<p>So far we haven&#8217;t had any adverse effects on our development server doing things this way but if anyone has a better method or potential issues with this one let us know.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[The Big Picture: Liferay + Alfresco + Jasig CAS + OpenLDAP]]></title>
<link>http://estigmatizados.wordpress.com/2009/08/13/the-big-picture-liferay-alfresco-jasig-cas-openldap/</link>
<pubDate>Thu, 13 Aug 2009 16:05:25 +0000</pubDate>
<dc:creator>Fer</dc:creator>
<guid>http://estigmatizados.wordpress.com/2009/08/13/the-big-picture-liferay-alfresco-jasig-cas-openldap/</guid>
<description><![CDATA[The Big Picture Nos vamos acercando al entorno deseado. Tenemos Liferay y Alfresco autenticando con ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><div id="attachment_80" class="wp-caption alignleft" style="width: 310px"><img class="size-medium wp-image-80" title="proyecto" src="http://estigmatizados.wordpress.com/files/2009/08/proyecto.png?w=300" alt="The Big Picture" width="300" height="104" /><p class="wp-caption-text">The Big Picture</p></div>
<p>Nos vamos acercando al entorno deseado. Tenemos Liferay y Alfresco autenticando con OpenLDAP. Es hora de añadir el Single Sign On (SSO), utilizando una solución desarrollada por la universidad de Yale: Central Authentication System (CAS).</p>
<div class="mceTemp">En primer lugar vamos a configurar el servidor CAS:</div>
<ol>
<li>
<div class="mceTemp">Deberemos configurar un &#8220;LDAP Authentication Handler&#8221;</div>
</li>
<li>
<div class="mceTemp">Deberemos configurar el servidor para SSL.</div>
</li>
<li>
<div class="mceTemp">Deberemos configurar los clientes para que confíen en el certificado del servidor generado en el punto (2) -esto es necesario porque vamos a trabajar con certificados de prueba (self-signed)</div>
</li>
</ol>
<p class="mceTemp"><!--more--></p>
<h1>Configuración de CAS y LDAP</h1>
<p><a href="http://www.ja-sig.org/wiki/display/CASUM/LDAP">CAS User Manual</a></p>
<h2>Paso 1.1</h2>
<p>El primer paso que indica el manual es añadir la siguiente dependencia a pom.xml</p>
<p><span style="color:#333399;">&#60;dependency&#62;<br />
     &#60;groupId&#62;${project.groupId}&#60;/groupId&#62;<br />
     &#60;artifactId&#62;cas-server-support-ldap&#60;/artifactId&#62;<br />
     &#60;version&#62;${project.version}&#60;/version&#62;<br />
&#60;/dependency&#62;</span></p>
<p>Sé que tiene que ver con Maven, pero dado que Maven lo asocio a la construcción, no sé cuál es la razón de añadir esta declaración. Si algún alma caritativa puede aportar algo de luz mediante un comentario Dios se lo pagará con muchos hijos -o mujeres u hombres-</p>
<p>Mi pompom, mi pom.xml lo tengo en: <strong>C:\desarrollo\java\install\tomcat-5.5\webapps\cas-server-webapp-3.3.3\META-INF\maven\org.jasig.cas\cas-server-webapp\pom.xml</strong></p>
<h2>Paso 1.2</h2>
<p>Añadir los beans al archivo: <strong>C:\desarrollo\java\install\tomcat-5.5\webapps\cas-server-webapp-3.3.3\WEB-INF\deployerConfigContext.xml</strong></p>
<p><strong>NOTA: Mi servidor es gammu y openLDAP está corriendo en el puerto 389.</strong></p>
<h3>1.2.1 Configuración del bean id=&#8221;contextSource&#8221;</h3>
<p>En el bean con id contextSource debemos indicar:<br />
Las URL del servidor LDAP. En mi caso <strong>ldap://gammu:389<br />
</strong>El DN del usuario con el que conectaremos con LDAP. En mi caso cn=admin,dc=uniovi,dc=es<br />
La contraseña de este usuario. En mi caso <strong>secret</strong> -contraseña por defecto en OpenLDAP y Apache DS-</p>
<h3> 1.2.2 Configuración del bean id=&#8221;authenticationManager&#8221;</h3>
<p>En la propiedad <span style="color:#ff0000;"><strong>authenticationHandlers</strong> </span>define una lista de manejadores. Debemos eliminar o comentar el SimpleTestUsernamePasswordAuthenticationHandler y sustituirlo por el FastBindLdapAuthenticationHandler -en mi caso-.</p>
<h3>1.2.3 Propiedades del FastBindLdapAuthenticationHandler</h3>
<p>Simplemente tenemos que configurar la propiedad <span style="color:#ff0000;">filter</span>. Esta propiedad define cómo buscar usuarios en el árbol LDAP. En mi caso utilizo el UID, en otros casos puede ser necesario comprobar por el CN. En mi caso: <strong>uid=%u,ou=people,dc=uniovi,dc=es</strong></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- deployerConfigContext.xml &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>&#60;beans xmlns=&#8221;<a href="http://www.springframework.org/schema/beans">http://www.springframework.org/schema/beans</a>&#8220;<br />
       xmlns:xsi=&#8221;<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>&#8220;<br />
       xmlns:p=&#8221;<a href="http://www.springframework.org/schema/p">http://www.springframework.org/schema/p</a>&#8220;<br />
       xsi:schemaLocation=&#8221;<a href="http://www.springframework.org/schema/beans">http://www.springframework.org/schema/beans</a> <a href="http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">http://www.springframework.org/schema/beans/spring-beans-2.0.xsd</a>&#8220;&#62;<br />
 <br />
 <strong><span style="color:#0000ff;">&#60;!&#8211; FER_BEGIN &#8211;&#62;<br />
 &#60;bean id=&#8221;contextSource&#8221;&#62;<br />
  &#60;property name=&#8221;pooled&#8221; value=&#8221;true&#8221;/&#62;<br />
  &#60;property name=&#8221;urls&#8221;&#62;<br />
   &#60;list&#62;<br />
    &#60;value&#62;ldap://gammu:389&#60;/value&#62;<br />
   &#60;/list&#62;<br />
  &#60;/property&#62;<br />
  &#60;property name=&#8221;userDn&#8221; value=&#8221;cn=admin,dc=uniovi,dc=es&#8221;/&#62;<br />
  &#60;property name=&#8221;password&#8221; value=&#8221;secret&#8221;/&#62;<br />
  &#60;property name=&#8221;baseEnvironmentProperties&#8221;&#62;<br />
   &#60;map&#62;<br />
    &#60;entry&#62;<br />
     &#60;key&#62;<br />
      &#60;value&#62;java.naming.security.authentication&#60;/value&#62;<br />
     &#60;/key&#62;<br />
     &#60;value&#62;simple&#60;/value&#62;<br />
    &#60;/entry&#62;<br />
   &#60;/map&#62;<br />
  &#60;/property&#62;<br />
 &#60;/bean&#62;  <br />
 &#60;!&#8211; FER_END &#8211;&#62;<br />
</span></strong><strong><span style="color:#0000ff;">&#8230;</span></strong></p>
<p><span style="color:#000000;">&#60;bean id=&#8221;authenticationManager&#8221;<br />
  class=&#8221;org.jasig.cas.authentication.AuthenticationManagerImpl&#8221;&#62;<br />
</span><span style="color:#000000;">&#8230;<br />
</span><span style="color:#000000;">&#60;property name=&#8221;authenticationHandlers&#8221;&#62;<br />
   &#60;list&#62;<br />
      &#60;bean class=&#8221;org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler&#8221;  p:httpClient-ref=&#8221;httpClient&#8221; /&#62;<br />
<span style="color:#99cc00;">    &#60;!&#8211; FER_BEGIN<br />
</span><span style="color:#99cc00;">    &#60;bean<br />
     class=&#8221;org.jasig.cas.authentication.handler.support.SimpleTestUsernamePasswordAuthenticationHandler&#8221; /&#62;<br />
    FER_END &#8211;&#62;</span>  <br />
<span style="color:#333399;"><strong>    &#60;bean class=&#8221;org.jasig.cas.adaptors.ldap.FastBindLdapAuthenticationHandler&#8221;&#62;<br />
       &#60;property name=&#8221;filter&#8221; value=&#8221;uid=%u,ou=people,dc=uniovi,dc=es&#8221; /&#62;<br />
       &#60;property name=&#8221;contextSource&#8221; ref=&#8221;contextSource&#8221; /&#62;<br />
    &#60;/bean&#62;    <br />
</strong></span>   &#60;/list&#62;<br />
  &#60;/property&#62;<br />
</span><span style="color:#000000;">&#60;/bean&#62;<br />
&#8230;</span></p>
<p><span style="color:#000000;">&#60;/beans&#62;</span></p>
<h2><span style="color:#000000;">Paso 2.1</span></h2>
<p><span style="color:#000000;">Me adelanto un poco, pero prefiero comentar aquí un error que veréis cuando configuréis Alfresco para CAS. Si no hemos definido un certificado de servidor para nuestro Tomcat_CAS Alfresco nos mostrará un mensaje tal como:</span></p>
<blockquote><p><span style="color:#ff0000;">edu.yale.its.tp.cas.client.CASAuthenticationException: Unable to validate ProxyTicketValidator [[edu.yale.its.tp.cas.client.ProxyTicketValidator proxyList=[null] [edu.yale.its.tp.cas.client.ServiceTicketValidator casValidateUrl=[https://localhost:8444/cas-server-webapp-3.3.3/serviceValidate] ticket=[ST-10-46fBuOkjqiPZUoCrUVc6-cas] service=[http%3A%2F%2Flocalhost%3A9090%2Falfresco%2Ffaces%2Fjsp%2Fdashboards%2Fcontainer.jsp] renew=false]]]</span></p></blockquote>
<p><span style="color:#000000;">Para evitarlo tenemos que configurar Tomcat para SSL -<a href="http://wp.me/pB8Az-10">ver el post de configuración de Tomcat con SSL</a>- y añadir el certificado a la lista de certificados de confianza de la JRE.</span></p>
<p><span style="color:#000000;">Si tanto Alfresco como Liferay los tenéis en un mismo servidor, utilizad la misma JRE para ambos y no tendréis problemas de confianza. En el caso de tenerlos separados tenéis que importar el certificado a cada JRE -dado que me refiero siempre a certificados de prueba, no de VeriSign-.</span></p>
<p><span style="color:#000000;">Añadir una <strong>trusted certificate entry </strong>se puede hacer con la herramienta keytool o usando un pequeño programa Java muy sencillo.</span><a href="http://blogs.sun.com/andreas/entry/no_more_unable_to_find">InstallCert</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Software LDAP]]></title>
<link>http://estigmatizados.wordpress.com/2009/08/11/software-ldap/</link>
<pubDate>Tue, 11 Aug 2009 10:55:48 +0000</pubDate>
<dc:creator>Fer</dc:creator>
<guid>http://estigmatizados.wordpress.com/2009/08/11/software-ldap/</guid>
<description><![CDATA[Dado que estamos trabajando contiuamente con LDAP en Windows, voy a incluir algunas direcciones con ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Dado que estamos trabajando contiuamente con LDAP en Windows, voy a incluir algunas direcciones con software de interés. Principalmente dónde encontrar una versión de OpenLDAP compilada para Windows.</p>
<ul>
<li>Servidor OpenLDAP para Windows: <a href="http://www.userbooster.de/en/download/openldap-for-windows.aspx">Userbooster OpenLDAP for Windows version 2.4.11</a></li>
<li>Servidor LDAP de Apache: <a href="http://directory.apache.org/">Apache Directory</a></li>
<li>Cliente LDAP: <a href="http://directory.apache.org/studio/">Apache Directory Studio</a></li>
<li>Cliente LDAP: <a href="http://www.ldapbrowser.com/">Softerra LDAP Browser</a></li>
<li>Manual OpenLDAP: <a href="http://www.openldap.org/doc/admin24/">OpenLDAP Admin Guide</a></li>
</ul>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Adventures in CentOS-Land (Part 3)]]></title>
<link>http://serverhorror.wordpress.com/2009/07/21/adventures-in-centos-land-part-3/</link>
<pubDate>Tue, 21 Jul 2009 12:00:56 +0000</pubDate>
<dc:creator>Martin</dc:creator>
<guid>http://serverhorror.wordpress.com/2009/07/21/adventures-in-centos-land-part-3/</guid>
<description><![CDATA[Let&#8217;s get to work with CentOS5 now that we have set up the yum repositories and are able to in]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Let&#8217;s get to work with CentOS5 now that we have set up the yum repositories and are able to install all the software we need. As a short reminder our requirements listing again. So let&#8217;s <a href="http://serverhorror.wordpress.com/2009/07/20/adventures-in-centos-land-part-2/">continue from last time&#8230;</a></p>
<p>Our requirements are the following:<!--more--></p>
<ul>
<li>nagios for monitoring of
<ul>
<li>disk space</li>
<li>system load</li>
<li>service availability</li>
<li>&#8230;</li>
</ul>
</li>
<li>openLDAP (v3 only and TLS only)</li>
<li>SMTP with Sender Authentication over TLS only</li>
<li>IMAPs (only, and only over TLS)</li>
<li>a webmail interface for easy access from anywhere &#8211; also TLS only</li>
</ul>
<p>Since I know <a href="http://www.postfix.org/">Postfix</a> best I decided to go with it, also <a href="http://www.dovecot.org/">Dovecot</a> is a nice (and fast) IMAP server (as I learned on the way). User Information for the mail users should come from <a href="http://www.openldap.org">LDAP</a> &#8211; that also makes it easy to set up some password changing webform (did I mention: TLS only).</p>
<p>But first the basic setup. This is where the problems started:</p>
<ul>
<li>no nagios in the official repositories &#8211; rpmforge has them
<ul>
<li>it seems Dag Wieers is an official package maintainer taking part in this repo so it seems trustworthy according to some Google research</li>
</ul>
</li>
<li>postfix seems to be in the CentOsPlus repository</li>
</ul>
<p>Let&#8217;s see, yum is the package manager and seems to work quite well, no sign of RPM-dependency hell any more.</p>
<p>O.K. &#8211; so much for a basic running service. Of course that doesn&#8217;t do that much that is useful for us. Let&#8217;s first configure slapd and a basic LDAP tree. The config of slapd is rather simple, we don&#8217;t really have any users except one so we don&#8217;t exactly need any groups. Why bother with LDAP then? Well, once you get used to having LDAP and a nice GUI tool is actually a lot <del>easier</del> more convenient to deal with than with the good unix passwords. <strong>Note: I recommend to NEVER EVER put system users required to start daemons/applications in LDAP, don&#8217;t even think about it!</strong></p>
<p>Now here comes the slapd.conf:</p>
<pre style="padding-left:30px;"># egrep -v '^ *#&#124;^$' /etc/openldap/slapd.conf
include        /etc/openldap/schema/core.schema
include        /etc/openldap/schema/cosine.schema
include        /etc/openldap/schema/inetorgperson.schema
include        /etc/openldap/schema/nis.schema
include        /etc/openldap/schema/misc.schema
pidfile        /var/run/openldap/slapd.pid
argsfile    /var/run/openldap/slapd.args
TLSCACertificateFile /etc/pki/tls/certs/ca-bundle.crt
TLSCertificateFile /etc/pki/tls/certs/slapd.pem
TLSCertificateKeyFile /etc/pki/tls/certs/slapd.pem
access to dn.base="" by * read
access to dn.base="cn=Subschema" by * read
access to *
 by self write
 by users read
 by anonymous auth
database    bdb
suffix        "dc=example,dc=org"
rootdn        "cn=System Maintenance Account,ou=System,dc=example,dc=org"
rootpw changeme
directory    /var/lib/ldap
index objectClass                       eq,pres
index ou,cn,mail,surname,givenname      eq,pres,sub
index uidNumber,gidNumber,loginShell    eq,pres
index uid,memberUid                     eq,pres,sub
index nisMapName,nisMapEntry            eq,pres,sub</pre>
<p>And this is our LDIF (already with the user we want to use for mailing):</p>
<pre style="padding-left:30px;">dn: dc=example,dc=org
objectClass: dcObject
objectClass: top
objectClass: organization
dc: dc=example,dc=org
o: Example Corp.

dn: ou=People,dc=example,dc=org
objectClass: organizationalUnit
objectClass: top
ou: People

dn: cn=Alice  Squarepants,ou=People,dc=example,dc=org
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
objectClass: top
objectClass: inetLocalMailRecipient
cn: Alice  Squarepants
mail: asquarepants@example.org
mailLocalAddress: alice@example.org
sn: Doe
userPassword: changeme

dn: ou=System,dc=example,dc=org
objectClass: organizationalUnit
objectClass: top
ou: System

dn: cn=System Maintenance Account,ou=System,dc=example,dc=org
objectClass: organizationalRole
objectClass: top
objectClass: simpleSecurityObject
cn: System Maintenance Account
userPassword: changeme

dn: cn=postfix,ou=System,dc=example,dc=org
objectClass: organizationalRole
objectClass: top
objectClass: simpleSecurityObject
cn: postfix
userPassword: changeme

dn: cn=dovecot,ou=System,dc=example,dc=org
objectClass: organizationalRole
objectClass: top
objectClass: simpleSecurityObject
cn: dovecot
userPassword: changeme

dn: cn=Bob,ou=People,dc=example,dc=org
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
objectClass: top
objectClass: inetLocalMailRecipient
cn: Bob  Squarepants
mail: bob@example.org
sn: Bob Squarepants
userPassword: changeme

dn: cn=Postmaster,ou=People,dc=example,dc=org
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
objectClass: top
objectClass: inetLocalMailRecipient
cn: Postmaster
mail: postmaster@example.org
mailLocalAddress: hostmaster@example.org
mailLocalAddress: abuse@example.org
sn: Postmaster
userPassword: changeme</pre>
<p>Let&#8217;s see now what we have.</p>
<ul>
<li>Non-System users ready to use in LDAP &#8211; <span style="color:#ff0000;">check</span></li>
<li>Aliases that can be used easily &#8211; <span style="color:#ff0000;">check</span></li>
<li>a container for &#8220;real people&#8221; vs. a container for &#8220;role objects&#8221; &#8211; <span style="color:#ff0000;">check</span></li>
<li><span style="color:#ff0000;"><span style="color:#000000;">Hopefully no typos since I made some modifications like changing the passwors (of course) the Root DSE and some DNs</span></span></li>
</ul>
<p>Next time we&#8217;ll see how to configure Dovecot to use this information and automagically create the correct mailbox with the information provided from our LDAP tree.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[LDIF to TSV conversion]]></title>
<link>http://register72.wordpress.com/2009/07/09/ldif-to-tsv-conversion/</link>
<pubDate>Thu, 09 Jul 2009 08:52:10 +0000</pubDate>
<dc:creator>register72</dc:creator>
<guid>http://register72.wordpress.com/2009/07/09/ldif-to-tsv-conversion/</guid>
<description><![CDATA[Extracting ldif data is not enough when you have to import them into some other data source. The mos]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Extracting ldif data is not enough when you have to import them into some other data source. The most simple solution is to convert ldif to some delimited file format ( CSV or TSV ) that is more supported from existing tools and software.  The best online resource I was able to find is <a href="http://returnbooleantrue.blogspot.com/2009/01/converting-ldifldap-data-into-csv-file.html">this one</a>. Sadly python is not contemplated among programming languages used by my customer. So I had to write something myself in C++. I chosed TSV over CSV because distinguished names contain commas and surrounding them with double quotes (&#8220;) is sometimes not so well digested by some software. The usage is simple:</p>
<p>Ldif2Tsv <em>&#60;ldif file&#62; &#60;tsv file&#62; &#60;attribute1&#62; &#60;attribute2&#62; &#60;attribute 3&#62; &#8230; &#60;attribute n&#62;</em></p>
<p>You just type the name of the compiled program followed by the input file, the ouput file and an arbitrary list of attributes that you would like to have in the tsv output. You  can copy and paste the code below or <a href="http://rapidshare.de/files/47799509/Ldif2Tsv.cpp.html">download the whole thing here</a>.</p>
<p> </p>
<pre class="brush: cpp;">

#include &#60;iostream&#62;
#include &#60;fstream&#62;
#include &#60;string&#62;
#include &#60;map&#62;
#include &#60;vector&#62;

using namespace std;

string&#38; trim(string &#38;str)
{
    int i,j,start,end;

    //ltrim
    for (i=0; (str[i]!=0 &#38;&#38; str[i]&#60;=32); )
        i++;
    start=i;

    //rtrim
    for(i=0,j=0; str[i]!=0; i++)
        j = ((str[i]&#60;=32)? j+1 : 0);
    end=i-j;
    str = str.substr(start,end-start);
    return str;
}

int main(int argc, char* argv[])
{
 std::map&#60;std::string,std::string&#62; entry;
 const char* SEPARATOR=&#34;\t&#34;;
 
 if(argc&#60; 4)
 {
  cout&#60;&#60;&#34;Usage Ldif2Tsv &#60;ldif file&#62; &#60;tsv file&#62; &#60;attribute1&#62; &#60;attribute2&#62; &#60;attribute 3&#62; ... &#60;attribute n&#62;&#34;&#60;&#60;endl;
  return 0;
 }
 
 ifstream ifile; 
 ofstream ofile;;

 ifile.open(argv[1]);
 if(ifile.is_open()!=true)
 {
  cout&#60;&#60;&#34;Cannot open inputfile &#34;&#60;&#60;argv[1]&#60;&#60;endl;
  return 0;
 }

 ofile.open(argv[2]);
 if(ofile.is_open()!=true)
 {
  cout&#60;&#60;&#34;Cannot open outputfile &#34;&#60;&#60;argv[2]&#60;&#60;endl;
  return 0;
 }

 vector&#60;string&#62; attributes;
 for(int i=3;i&#60;argc;i++)
 {
  attributes.push_back(argv[i]);
 }

 for(size_t i=0;i&#60;attributes.size()-1;i++)
 {
  ofile&#60;&#60;attributes[i]&#60;&#60;SEPARATOR;
 }
 ofile&#60;&#60;attributes[attributes.size()-1]&#60;&#60;endl;

 std::string line;
 std::string prevvalue=&#34;&#34;;
 std::string prevattribute=&#34;&#34;;
 
 std::string value=&#34;&#34;;
 std::string attribute=&#34;&#34;;

 int coloncount=0;
 bool firstline=true;

 while(!ifile.eof())
 {
  //We have a new (attribute:value) pair, keep track of the previous one
  if(coloncount==2)
  {    
    entry[prevattribute]=prevvalue;
    prevattribute=attribute;
    prevvalue=value;
    coloncount=1;
  }

  getline(ifile,line);

  //Empty line: end of the old entry and beginning of a new one. Keep track of the
  //last attribute in the entry and write down the tsv row for this entry
  if(line.length()==0)
  {
   entry[prevattribute]=prevvalue;
   for(size_t i=0;i&#60;attributes.size()-1;i++)
   {
    ofile&#60;&#60;entry[attributes[i]]&#60;&#60;SEPARATOR;
    
   }
   ofile&#60;&#60;entry[attributes[attributes.size()-1]]&#60;&#60;endl;

   prevvalue=&#34;&#34;;
   prevattribute=&#34;&#34;;
   firstline=true;
   coloncount=0;
   continue;
  }

  
  string::size_type colonfound =line.find_first_of(&#34;:&#34;);
  if(colonfound==string::npos)
  {
   //We are on a broken line. Accumulate the value
    prevvalue=prevvalue.append(trim(line));
    continue;
  }

  attribute=line.substr(0,colonfound);
  attribute=trim(attribute);
  value=line.substr(colonfound+1,line.length()-colonfound-1);
  value=trim(value);
  coloncount++;
  if(firstline==true)
  {
   prevattribute=attribute;
   prevvalue=value;
   firstline=false;
  }

 }
 return 0;
}
</pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Dumping an Openldap directory ]]></title>
<link>http://register72.wordpress.com/2009/07/05/dumping-an-openldap-directory/</link>
<pubDate>Sun, 05 Jul 2009 08:28:42 +0000</pubDate>
<dc:creator>register72</dc:creator>
<guid>http://register72.wordpress.com/2009/07/05/dumping-an-openldap-directory/</guid>
<description><![CDATA[I often have to work on data coming from ldap sources. Indeed I also developed some customs openldap]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I often have to work on data coming from ldap sources. Indeed I also developed some customs openldap backends that aggregate identity information in peculiar ways to satisfy the needs of one of our clients. A few days ago I was asked to make a complete dump of an Ldap tree because there was the need to import most of the data in a database.</p>
<p>If you have administrator privileges the easiest way to do so consists of three steps:</p>
<ul>
<li>
<div style="text-align:left;">Disable logging. In the slapd.conf configuration file set the <a href="http://www.zytrax.com/books/ldap/ch6/#loglevel">loglevel</a> directive to 0. Even if this is not recommended it will boost the speed of your dump considerably. Obviously every  conscientious administrator will restore the old value after the dump is finished.</div>
</li>
<li>
<div style="text-align:left;">Set the <a href="http://www.zytrax.com/books/ldap/ch6/#sizelimit">sizelimit</a> directive to <em>unlimited</em>. This will allow to retrieve all of the ldap tree with a single query. As usual restore the previous sizelimit when you are done with the dump.</div>
</li>
<li>
<div style="text-align:left;">Finally dump the whole directory in LDIF format with a single ldapsearch: ldapsearch -h <em>&#60;ldapserverhostname&#62;</em> -b &#8220;<em>dc=sampleRoot</em>&#8221; -s sub -L objectClass=* &#62;<em>dumpfile.ldif</em></div>
</li>
</ul>
<p style="text-align:left;">LDIF is a textual format that is very handy to parse and to process. The format is made by a sequence of lines where each one represents an attribute of a given entry.  A new entry is separated by the previous one by a blank line, and each line has both the name of the attribute and its value separated by a colon.</p>
<p style="text-align:left;">On the internet is easy to find many free libraries written in various programming languages that are able to deal with LDIF.  However these libraries are usually very picky about the format and not so forgiving when the file contains small errors. One recurring problem I found while dumping data as described above is to have a newline just in the middle of the attribute value,like this:</p>
<pre>dn: cn=john,ou=officeUs,o=
    Usa,dc=sample
attribute1=value
....</pre>
<p>I have written a small c++ program that I would like to share that repairs these type of defects. It takes two arguments : the file to repair and the output path for the repaired file. It is written in standard c++ and should compile on any available c++ compiler. The source code is licensed under <a href="http://www.codeproject.com/info/cpol10.aspx">The Code Project Open License (CPOL) </a>. You may also download it from <a href="http://rapidshare.de/files/47789835/cleanldif.cpp.html">here</a>.</p>
<div id="_mcePaste" style="position:absolute;width:1px;height:1px;overflow:hidden;top:394px;left:-10000px;">
<h1 class="TitleBar">The Code Project Open License (CPOL) 1.02</h1>
</div>
<p> </p>
<pre class="brush: cpp;">

#include &#60;iostream&#62;
#include &#60;fstream&#62;
#include &#60;string&#62;

using namespace std;

string&#38; trim(string &#38;str)
{
    int i,j,start,end;

    //ltrim
    for (i=0; (str[i]!=0 &#38;&#38; str[i]&#60;=32); )
        i++;
    start=i;

    //rtrim
    for(i=0,j=0; str[i]!=0; i++)
        j = ((str[i]&#60;=32)? j+1 : 0);
    end=i-j;
    str = str.substr(start,end-start);
    return str;
}

int main(int argc, char* argv[])
{
 
 if(argc!= 3)
 {
  cout&#60;&#60;&#34;Usage ldifclean inputfile outputfile&#34;&#60;&#60;endl;
  return 0;
 }
 
 ifstream ifile; 
 ofstream ofile;;

 ifile.open(argv[1]);
 if(ifile.is_open()!=true)
 {
  cout&#60;&#60;&#34;Cannot open inputfile &#34;&#60;&#60;argv[1]&#60;&#60;endl;
  return 0;
 }

 ofile.open(argv[2]);
 if(ofile.is_open()!=true)
 {
  cout&#60;&#60;&#34;Cannot open outputfile &#34;&#60;&#60;argv[2]&#60;&#60;endl;
  return 0;
 }
 
 std::string line;
 std::string prevvalue=&#34;&#34;;
 std::string prevattribute=&#34;&#34;;
 
 std::string value=&#34;&#34;;
 std::string attribute=&#34;&#34;;

 int coloncount=0;
 bool firstline=true;

 while(!ifile.eof())
 {
  //We have a new (attribute:value) pair, write down the previous one
  if(coloncount==2)
  {    
    ofile&#60;&#60;prevattribute&#60;&#60;&#34;:&#34;&#60;&#60;prevvalue&#60;&#60;endl;
    prevattribute=attribute;
    prevvalue=value;
    coloncount=1;
  }

  getline(ifile,line);

  //Empty line: end of the old entry and beginning of a new one
  if(line.length()==0)
  {
   ofile&#60;&#60;prevattribute&#60;&#60;&#34;:&#34;&#60;&#60;prevvalue&#60;&#60;endl;  
   ofile&#60;&#60;endl;
   prevvalue=&#34;&#34;;
   prevattribute=&#34;&#34;;
   firstline=true;
   coloncount=0;
   continue;
  }

  
  string::size_type colonfound =line.find_first_of(&#34;:&#34;);
  if(colonfound==string::npos)
  {
   //We are on a broken line. Accumulate the value
    prevvalue=prevvalue.append(trim(line));
    continue;
  }

  attribute=line.substr(0,colonfound);
  value=line.substr(colonfound+1,line.length()-colonfound-1);
  coloncount++;
  if(firstline==true)
  {
   prevattribute=attribute;
   prevvalue=value;
   firstline=false;
  }

 }
 return 0;
}
</pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Servidor de Nomes (BIND) com OpenLDAP]]></title>
<link>http://diegograssato.wordpress.com/2009/06/24/283/</link>
<pubDate>Wed, 24 Jun 2009 10:48:20 +0000</pubDate>
<dc:creator>DIEGO PEREIRA GRASSATO</dc:creator>
<guid>http://diegograssato.wordpress.com/2009/06/24/283/</guid>
<description><![CDATA[By:Diego Pereira Grassato 23/Julho/2009 Muitas vezes, é desejável para armazenar informações de DNS ]]></description>
<content:encoded><![CDATA[By:Diego Pereira Grassato 23/Julho/2009 Muitas vezes, é desejável para armazenar informações de DNS ]]></content:encoded>
</item>
<item>
<title><![CDATA[OpenLDAP]]></title>
<link>http://srgperez.wordpress.com/2009/06/24/openldap/</link>
<pubDate>Wed, 24 Jun 2009 08:39:55 +0000</pubDate>
<dc:creator>srgperez</dc:creator>
<guid>http://srgperez.wordpress.com/2009/06/24/openldap/</guid>
<description><![CDATA[¿Qué es el Directorio LDAP? LDAP (&#8220;Lightweight Directory Acces Protocol&#8221;, en español Pro]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><h4><strong>¿Qué es el Directorio LDAP?</strong></h4>
<p><span class="negrita">LDAP</span> (&#8220;Lightweight Directory Acces Protocol&#8221;, en español Protocolo Ligero de Acceso a Directorios) es un protocolo de tipo cliente-servidor para acceder a un servicio de directorio.</p>
<p>Se usó inicialmente como un Front-end o interfaz final para x.500, pero también puede usarse con servidores de directorio únicos y con otros tipos de servidores de directorio como OpenLDAP.</p>
<p>Cada item (entrada) en el directorio LDAP describe un objeto (por ejemplo: una persona, un recurso de red, una organización) y tiene un único identificador llamado <span class="negrita">Nombre Distinguido</span> (<span class="negrita">DN</span>, Distingued Name). La entrada consiste de una colección de atributos (por ejemplo una persona podría tener apellido, organización, e-mail). Para encontrar las entradas hay que navegar a través del <span class="negrita">Arbol de Información de Directorio</span> (<span class="negrita">DIT</span>, Directory Information Tree). En la raíz del árbol se encuentra El Mundo, el cual esta subdividido en el siguiente nivel en paises, y en el siguiente en organizaciones. Dentro de las organizaciones se alamcenan información de gente, recursos, etc.</p>
<p>La mayoría de la información disponible hoy vía LDAP es sobre personas y organizaciones, pero en LDAP también se puede almacenar información sobre otras entidades (o objetos) como recursos de red, aplicaciones&#8230;</p>
<p>El servicio LDAP se utiliza principalmente para buscar información de personas (dirección, número de teléfono, e-mail, etc.). Los campos básicos para realizar la búsqueda son: el nombre de la persona y el nombre de la organización a la que pertenece la persona (y departamento dentro de la organización).</p>
<p><a href="http://www.um.es/atica/ldap/" target="_blank">http://www.um.es/atica/ldap/</a></p>
<p><a href="http://mundopc.net/articulos/servicio-de-directorio-openldap/" target="_blank">http://mundopc.net/articulos/servicio-de-directorio-openldap/</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[OpenLdap Baseline Security Analyzer]]></title>
<link>http://toniocastro.wordpress.com/2009/06/22/openldap-baseline-security-analyzer/</link>
<pubDate>Mon, 22 Jun 2009 16:32:17 +0000</pubDate>
<dc:creator>toniocastro</dc:creator>
<guid>http://toniocastro.wordpress.com/2009/06/22/openldap-baseline-security-analyzer/</guid>
<description><![CDATA[Deixo un enlace a unha ferramenta que nos pode axudar a elaborar un listado de críterios que se debe]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Deixo un enlace a unha ferramenta que nos pode axudar a elaborar un listado de críterios que se deberian ter en conta a hora de securizar un directorio. Para elo faise uso dunha ferramenta de sw libre chamada  <a href="http://openldap-bsa.forja.rediris.es/ocil.html">OCIL Interpreter.</a></p>
<p>Ben, o mellor e que te informes por ti mesmo dado que na web hai moita documentación.</p>
<p style="text-align:center;">-<a href="http://openldap-bsa.forja.rediris.es/index.html"> OpenLdap BSA</a>-</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[OpenLDAP Error : Berkeley DB version mismatch]]></title>
<link>http://blogitknowledge.wordpress.com/2009/06/08/ldap/</link>
<pubDate>Mon, 08 Jun 2009 02:00:01 +0000</pubDate>
<dc:creator>Blog_Master</dc:creator>
<guid>http://blogitknowledge.wordpress.com/2009/06/08/ldap/</guid>
<description><![CDATA[ข้อผิดพลาดกรณีที่ 2 เกิดจากอ่านค่า BerkeyDB Library และ Header แล้วเวอร์ชันไม่ตรงกัน ดังแสดงตัวอย่าง]]></description>
<content:encoded><![CDATA[ข้อผิดพลาดกรณีที่ 2 เกิดจากอ่านค่า BerkeyDB Library และ Header แล้วเวอร์ชันไม่ตรงกัน ดังแสดงตัวอย่าง]]></content:encoded>
</item>
<item>
<title><![CDATA[ldapsearch OpenLDAP]]></title>
<link>http://tonginbox.wordpress.com/2009/06/07/ldapsearch-openldap/</link>
<pubDate>Sun, 07 Jun 2009 08:48:47 +0000</pubDate>
<dc:creator>tonginbox</dc:creator>
<guid>http://tonginbox.wordpress.com/2009/06/07/ldapsearch-openldap/</guid>
<description><![CDATA[/etc/openldap/slapd.conf access to * by dn="cn=Manager,dc=linux,dc=com" write by self write by * rea]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><pre style="border:solid 1px blue;font-size:1.3px em;color:blue;background:#FFFFB3;margin:10px;padding:10px;"><code style="font-size:1em;color:#008099;">
/etc/openldap/slapd.conf

access to *
by dn="cn=Manager,dc=linux,dc=com" write
by self write
by * read

~/.ldaprc

base    dc=linux,dc=com
binddn  cn=Manager,dc=linux,dc=com
host    localhost

# ldapsearch -x "cn=abc"
</code></pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[OpenLDAP Error: BerkeleyDB version incompatible]]></title>
<link>http://blogitknowledge.wordpress.com/2009/06/06/ldap-2/</link>
<pubDate>Sat, 06 Jun 2009 09:24:15 +0000</pubDate>
<dc:creator>Blog_Master</dc:creator>
<guid>http://blogitknowledge.wordpress.com/2009/06/06/ldap-2/</guid>
<description><![CDATA[ในตัวอย่างมีการติดตั้ง OpenLDAP version 2.4.16, แต่ใช้ BerkeleyDB (BDB) version 4.3.x โดยเมื่อคอมไพล]]></description>
<content:encoded><![CDATA[ในตัวอย่างมีการติดตั้ง OpenLDAP version 2.4.16, แต่ใช้ BerkeleyDB (BDB) version 4.3.x โดยเมื่อคอมไพล]]></content:encoded>
</item>
<item>
<title><![CDATA[Using OpenLDAP]]></title>
<link>http://wildanm.wordpress.com/2009/06/02/using-openldap/</link>
<pubDate>Tue, 02 Jun 2009 09:36:25 +0000</pubDate>
<dc:creator>Wildan Maulana</dc:creator>
<guid>http://wildanm.wordpress.com/2009/06/02/using-openldap/</guid>
<description><![CDATA[]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><!-- SlideShare error: doc is missing or has illegal characters /[^-_a-zA-Z0-9]/ --></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Alfresco OpenLDAP Related Resources]]></title>
<link>http://wildanm.wordpress.com/2009/05/28/alfresco-openldap-related-resources/</link>
<pubDate>Thu, 28 May 2009 11:14:53 +0000</pubDate>
<dc:creator>Wildan Maulana</dc:creator>
<guid>http://wildanm.wordpress.com/2009/05/28/alfresco-openldap-related-resources/</guid>
<description><![CDATA[Turn Alfresco OpenLDAP logging on, http://nix.theism.de/turn-alfresco-ldap-logging-on/]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><ol>
<li>Turn Alfresco OpenLDAP logging on, <a href="http://nix.theism.de/turn-alfresco-ldap-logging-on/" target="_blank">http://nix.theism.de/turn-alfresco-ldap-logging-on/</a></li>
</ol>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Openldap Mandriva Dit (II)]]></title>
<link>http://insanecrew.wordpress.com/2009/05/19/openldap-mandriva-dit-ii/</link>
<pubDate>Tue, 19 May 2009 15:44:57 +0000</pubDate>
<dc:creator>bersuitvera</dc:creator>
<guid>http://insanecrew.wordpress.com/2009/05/19/openldap-mandriva-dit-ii/</guid>
<description><![CDATA[Empezamos la segunda parte donde lo dejamos, daremos un vistazo al fichero insane.ldif para hacernos]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p style="text-align:justify;">Empezamos la segunda parte donde lo dejamos, daremos un vistazo al fichero insane.ldif para hacernos una idea de lo que contiene  nuestro directorio-árbol.  Vamos con la raíz:</p>
<blockquote><p># insanecrew.info<br />
dn: dc=insanecrew,dc=info<br />
dc: insanecrew<br />
objectClass: domain<br />
objectClass: domainRelatedObject<br />
associatedDomain: insanecrew.info</p></blockquote>
<p><!--more-->Inmediatamente después los dos primeros contenedores donde colocaremos a los usuarios y a los grupos.</p>
<blockquote><p># People, insanecrew.info<br />
dn: ou=People,dc=insanecrew,dc=info<br />
ou: People<br />
objectClass: organizationalUnit</p>
<p># Group, insanecrew.info<br />
dn: ou=Group,dc=insanecrew,dc=info<br />
ou: Group<br />
objectClass: organizationalUnit<br />
description: Container for user accounts</p></blockquote>
<p style="text-align:justify;">Ahora llega la primera sorpresa, <a href="http://www.mandriva.com">mandriva</a> crea dos unidades organizativas como contenedores de los usuarios y los grupos de los sistemas y servicios que usaran nuestro directorio como fuente para autenticarse.</p>
<blockquote><p># System Accounts, insanecrew.info<br />
dn: ou=System Accounts,dc=insanecrew,dc=info<br />
ou: System Accounts<br />
objectClass: organizationalUnit<br />
description: Container for System and Services privileged accounts</p>
<p># System Groups, insanecrew.info<br />
dn: ou=System Groups,dc=insanecrew,dc=info<br />
ou: System Groups<br />
objectClass: organizationalUnit<br />
description: Container for System and Services privileged groups</p></blockquote>
<p>Seguimos con otra vuelta de tuerca</p>
<blockquote><p># Hosts, insanecrew.info<br />
dn: ou=Hosts,dc=insanecrew,dc=info<br />
ou: Hosts<br />
objectClass: organizationalUnit<br />
description: Container for Samba machine accounts</p>
<p># Idmap, insanecrew.info<br />
dn: ou=Idmap,dc=insanecrew,dc=info<br />
ou: Idmap<br />
objectClass: organizationalUnit<br />
description: Container for Samba Winbind ID mappings</p>
<p># Address Book, insanecrew.info<br />
dn: ou=Address Book,dc=insanecrew,dc=info<br />
ou: Address Book<br />
objectClass: organizationalUnit<br />
description: Container for global address book entries</p></blockquote>
<p style="text-align:justify;">Tenemos una unidad organizativa que contendrá a los host de nuestra red. Seguimos complicando la cosa. otro contenedor para el mapeo de  uids y gid s para integrar samba y winbind con nuestro directorio,  ( en próximos capítulos suplantaremos a cualquier <a href="http://es.wikipedia.org/wiki/Active_Directory">AD</a>).<br />
La última Unidad Organizativa de esta tanda es un contenedor llamado libreta de direcciones ¿Nos dará soporte <a href="http://www.mandriva.com">mandriva</a> para enchufar nuestros clientes de correo al directorio? Pues eso parece.</p>
<blockquote><p># sudoers, insanecrew.info<br />
dn: ou=sudoers,dc=insanecrew,dc=info<br />
ou: sudoers<br />
objectClass: organizationalUnit<br />
description: Container for sudo related entries</p>
<p># dhcp, insanecrew.info<br />
dn: ou=dhcp,dc=insanecrew,dc=info<br />
ou: dhcp<br />
objectClass: organizationalUnit<br />
description: Container for DHCP related entries</p>
<p># dns, insanecrew.info<br />
dn: ou=dns,dc=insanecrew,dc=info<br />
ou: dns<br />
objectClass: organizationalUnit<br />
description: Container for DNS related entries</p></blockquote>
<p style="text-align:justify;">Las últimas versiones del paquete sudo permiten enchufarlo contra un directorio  para tener un control más exhaustivo de quién, como y cuando usa sudo en nuestros sistemas. Los servicios de infraestructura basados en GNU/Linux también  se integran con nuestro directorio, DHCP y  DNS. Sí, otra vez como el AD.</p>
<blockquote><p># Password Policies, insanecrew.info<br />
dn: ou=Password Policies,dc=insanecrew,dc=info<br />
ou: Password Policies<br />
objectClass: organizationalUnit<br />
description: Container for OpenLDAP password policies</p>
<p># default, Password Policies, insanecrew.info<br />
dn: cn=default,ou=Password Policies,dc=insanecrew,dc=info<br />
cn: default<br />
objectClass: pwdPolicy<br />
objectClass: namedObject<br />
pwdAttribute: userPassword</p>
<p># KDEConfig, insanecrew.info<br />
dn: ou=KDEConfig,dc=insanecrew,dc=info<br />
ou: KDEConfig<br />
objectClass: organizationalUnit<br />
description: Container for KDE configuration profiles</p>
<p># default, KDEConfig, insanecrew.info<br />
dn: ou=default,ou=KDEConfig,dc=insanecrew,dc=info<br />
ou: default<br />
objectClass: organizationalUnit<br />
description: Default KDE configuration for all users</p></blockquote>
<p style="text-align:justify;">Casi estamos acabando, ¡no sufran!  Los dos primeros contenedores contendrán la política de Password de nuestra empresa. Las dos últimas  Unidades Organizativas son para la configuración del escritorio kde de los puestos de nuestra red. ¡ Quién tuviera KDE en los escritos de usuario!</p>
<p style="text-align:justify;">De un tirón los DN (Distinguished Name) de los usuarios para administrar los servicios en nuestra corporación.</p>
<blockquote><p># Account Admin, System Accounts, insanecrew.info<br />
dn: uid=Account Admin,ou=System Accounts,dc=insanecrew,dc=info<br />
uid: Account Admin<br />
objectClass: account<br />
objectClass: simpleSecurityObject<br />
description: Account used to administer all users, groups, machines and genera<br />
l accounts</p>
<p># nssldap, System Accounts, insanecrew.info<br />
dn: uid=nssldap,ou=System Accounts,dc=insanecrew,dc=info<br />
uid: nssldap<br />
objectClass: account<br />
objectClass: simpleSecurityObject<br />
description: Unprivileged account which can be used by nss_ldap for when anony<br />
mous searches are disabled</p>
<p># MTA Admin, System Accounts, insanecrew.info<br />
dn: uid=MTA Admin,ou=System Accounts,dc=insanecrew,dc=info<br />
uid: MTA Admin<br />
objectClass: account<br />
objectClass: simpleSecurityObject<br />
description: Account used to administer email related attributes</p>
<p># XXXX Admin, System Accounts, insanecrew.info<br />
dn: uid=XXXX Admin,ou=System Accounts,dc=insanecrew,dc=info<br />
uid: XXXX Admin<br />
objectClass: account<br />
objectClass: simpleSecurityObject<br />
description: Account used to administer XXXX attributes</p></blockquote>
<p style="text-align:justify;">Sustituya XXXX por lectores y escritores en DHCP yDNS, SUDO, Libreta de direcciones, kde config..  (Si coloco el ldif entero esto se convertirá en eterno). A continuación tenemos los grupos ( groupOfNames) donde incluir a todos los administradores de los servicios antes nombrados, siguiendo la siguiente estructura</p>
<blockquote><p># XXXX Admins, System Groups, insanecrew.info<br />
dn: cn=XXXX Admins,ou=System Groups,dc=insanecrew,dc=info<br />
cn: XXXX Admins<br />
objectClass: groupOfNames<br />
description: Members can administer ou=XXXX entries and attributes<br />
owner: uid=XXXX Admin,ou=System Accounts,dc=insanecrew,dc=info<br />
member: uid=XXXX Admin,ou=System Accounts,dc=insanecrew,dc=info</p></blockquote>
<p>¡Ya era hora! Menudo lío, nos queda claro, que esto no es un directorio de “chichinabo” como dicen en mi pueblo. mandriva nos coloca a competir directemante en funcionalidad con el  “<a href="http://es.wikipedia.org/wiki/Active_Directory">otro</a>” directorio.<br />
Así que para el siguiente capitulo necesitaremos algo de ayuda:</p>
<ul>
<li> La<a href="http://wiki.mandriva.com/en/Projects/OpenLDAP_DIT"> documentación oficial</a> de proyecto en el wiki de <a href="http://www.mandriva.com">mandriva</a></li>
<li> La instalación de la<a href="http://mds.mandriva.org/content/MMC/install/en/mmc-generic-installation.html"> consola de administración</a> de mandriva, para manejar todo esto.</li>
<li>Documentación sobre la integración de <a href="http://bind9-ldap.bayour.com/">DNS</a> , <a href="https://www.secure-computing.net/wiki/index.php/OpenLDAP/sudo">sudo</a> y <a href="http://www.alcancelibre.org/article.php/dhcp-ldap-centos5">DHCP</a> con OpenLdap</li>
</ul>
</div>]]></content:encoded>
</item>

</channel>
</rss>
