<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="es">
	<id>https://manuais.iessanclemente.net/index.php?action=history&amp;feed=atom&amp;title=Configuraci%C3%B3n_do_cliente_LDAP._vello</id>
	<title>Configuración do cliente LDAP. vello - Historial de revisiones</title>
	<link rel="self" type="application/atom+xml" href="https://manuais.iessanclemente.net/index.php?action=history&amp;feed=atom&amp;title=Configuraci%C3%B3n_do_cliente_LDAP._vello"/>
	<link rel="alternate" type="text/html" href="https://manuais.iessanclemente.net/index.php?title=Configuraci%C3%B3n_do_cliente_LDAP._vello&amp;action=history"/>
	<updated>2026-10-24T17:39:33Z</updated>
	<subtitle>Historial de revisiones de esta página en la wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://manuais.iessanclemente.net/index.php?title=Configuraci%C3%B3n_do_cliente_LDAP._vello&amp;diff=43799&amp;oldid=prev</id>
		<title>Carrion: Página creada con «Neste apartado veremos os pasos que temos que seguir para configurar un equipo como cliente LDAP, de forma que o equipo tomará os usuarios e grupo do LDAP como usuarios e ...»</title>
		<link rel="alternate" type="text/html" href="https://manuais.iessanclemente.net/index.php?title=Configuraci%C3%B3n_do_cliente_LDAP._vello&amp;diff=43799&amp;oldid=prev"/>
		<updated>2014-04-27T18:19:11Z</updated>

		<summary type="html">&lt;p&gt;Página creada con «Neste apartado veremos os pasos que temos que seguir para configurar un equipo como cliente LDAP, de forma que o equipo tomará os usuarios e grupo do LDAP como usuarios e ...»&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Página nueva&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Neste apartado veremos os pasos que temos que seguir para configurar un equipo como cliente LDAP, de forma que o equipo tomará os usuarios e grupo do LDAP como usuarios e grupo do sistema, e autentificará os usuarios que inicien sesión validándose contra o servidor LDAP.&lt;br /&gt;
&lt;br /&gt;
Polo tanto, teremos que realizar esta configuración en todos os equipos que pertenzan ao noso dominio, incluíndo (e moi especialmente) ao servidor de dominio (no que se executa o servidor LDAP), xa que senón os usuarios e grupos do LDAP non serán válidos para el mesmo, aínda que sexa o que  almacena a información do directorio.&lt;br /&gt;
&lt;br /&gt;
== Instalar os paquetes necesarios ==&lt;br /&gt;
Instalaremos o paquete &amp;#039;&amp;#039;&amp;#039;libnss-ldap&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 sudo apt-get install libnss-ldap&lt;br /&gt;
&lt;br /&gt;
A instalación deste paquete obrigará tamén a instalación do paquete &amp;#039;&amp;#039;&amp;#039;ldap-auth-config&amp;#039;&amp;#039;&amp;#039;, que permite configurar a autentificación do equipo contra un servidor LDAP. Lanzarase automaticamente un asistente para configurar a conexión co servidor LDAP:&lt;br /&gt;
&amp;lt;gallery caption=&amp;#039;&amp;#039;Configuración do paquete ldap-auth-config&amp;#039;&amp;#039; widths=&amp;quot;350px&amp;quot;  heights=&amp;quot;250px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
Image:Platega_U910_Server_Configuracion_Cliente_LDAP1.png|Introducimos a URL da conexión do servidor LDAP (&amp;#039;&amp;#039;&amp;#039;ldap://IPServidor&amp;#039;&amp;#039;&amp;#039;). OLLO: &amp;#039;&amp;#039;&amp;#039;ldap non ldapi&amp;#039;&amp;#039;&amp;#039; e 2 &amp;#039;&amp;#039;&amp;#039;/&amp;#039;&amp;#039;&amp;#039; e non 3 &amp;#039;&amp;#039;&amp;#039;/&amp;#039;&amp;#039;&amp;#039;, isto é &amp;#039;&amp;#039;&amp;#039;ladp://&amp;#039;&amp;#039;&amp;#039; e non &amp;#039;&amp;#039;&amp;#039;ldap:///&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
Image:Platega_U910_Server_Configuracion_Cliente_LDAP2.png|Introducimos a rama base na que se atopan os usuarios e grupos no directorio.&lt;br /&gt;
Image:Platega_U910_Server_Configuracion_Cliente_LDAP3.png|Seleccionamos a versión 3 do protocolo LDAP.&lt;br /&gt;
Image:Platega_U910_Server_Configuracion_Cliente_LDAP4.png|Se queremos que os usuarios poidan cambiar o seu contrasinal dende os equipos cliente, teremos que activar a opción de introducir os datos do administrador do LDAP. &amp;#039;&amp;#039;&amp;#039;Ollo&amp;#039;&amp;#039;&amp;#039;, que nun caso real haberá que valorar se nos interesa ou non esta opción, xa que o contrasinal do administrador do LDAP almacénase, só accesible para o usuario &amp;#039;&amp;#039;root&amp;#039;&amp;#039;, no ficheiro &amp;#039;&amp;#039;/etc/ldap.secret&amp;#039;&amp;#039;, pero arrancando o equipo con un live-CD e montando a partición de sistema de Ubuntu, calquera podería ver este contrasinal. &lt;br /&gt;
Image:Platega_U910_Server_Configuracion_Cliente_LDAP5.png|Deixamos marcada a opción que indica que o servidor LDAP non require login para facer buscas no directorio.&lt;br /&gt;
Image:Platega_U910_Server_Configuracion_Cliente_LDAP6.png|Introducimos o dn do administrador do LDAP.&lt;br /&gt;
Image:Platega_U910_Server_Configuracion_Cliente_LDAP7.png|Introducimos o contrasinal do administrador do LDAP (No caso do noso exemplo é &amp;#039;&amp;#039;admin&amp;#039;&amp;#039;).&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Se cometésemos algún erro introducindo os datos de conexión pódese reconfigurar o paquete &amp;#039;&amp;#039;ldap-auth-config&amp;#039;&amp;#039; co mesmo asistente introducindo o seguinte comando:&lt;br /&gt;
 sudo dpkg-reconfigure ldap-auth-config&lt;br /&gt;
&lt;br /&gt;
=== Ficheiro de configuración /etc/ldap.conf===&lt;br /&gt;
No ficheiro &amp;#039;&amp;#039;&amp;#039;/etc/ldap.conf&amp;#039;&amp;#039;&amp;#039; pódese ver e modificar a configuración do cliente ldap.&lt;br /&gt;
Observar as seguintes entradas:&lt;br /&gt;
*base&lt;br /&gt;
*uri&lt;br /&gt;
*rootbinddn&lt;br /&gt;
*pam_password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
###DEBCONF###&lt;br /&gt;
##&lt;br /&gt;
## Configuration of this file will be managed by debconf as long as the&lt;br /&gt;
## first line of the file says &amp;#039;###DEBCONF###&amp;#039;&lt;br /&gt;
##&lt;br /&gt;
## You should use dpkg-reconfigure to configure this file via debconf&lt;br /&gt;
##&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# @(#)$Id: ldap.conf,v 1.38 2006/05/15 08:13:31 lukeh Exp $&lt;br /&gt;
#&lt;br /&gt;
# This is the configuration file for the LDAP nameservice&lt;br /&gt;
# switch library and the LDAP PAM module.&lt;br /&gt;
#&lt;br /&gt;
# PADL Software&lt;br /&gt;
# http://www.padl.com&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
# Your LDAP server. Must be resolvable without using LDAP.&lt;br /&gt;
# Multiple hosts may be specified, each separated by a &lt;br /&gt;
# space. How long nss_ldap takes to failover depends on&lt;br /&gt;
# whether your LDAP client library supports configurable&lt;br /&gt;
# network or connect timeouts (see bind_timelimit).&lt;br /&gt;
#host 127.0.0.1&lt;br /&gt;
&lt;br /&gt;
# The distinguished name of the search base.&lt;br /&gt;
base dc=iescalquera,dc=local&lt;br /&gt;
&lt;br /&gt;
# Another way to specify your LDAP server is to provide an&lt;br /&gt;
uri ldap://10.0.0.100&lt;br /&gt;
# Unix Domain Sockets to connect to a local LDAP Server.&lt;br /&gt;
#uri ldap://127.0.0.1/&lt;br /&gt;
#uri ldaps://127.0.0.1/   &lt;br /&gt;
#uri ldapi://%2fvar%2frun%2fldapi_sock/&lt;br /&gt;
# Note: %2f encodes the &amp;#039;/&amp;#039; used as directory separator&lt;br /&gt;
&lt;br /&gt;
# The LDAP version to use (defaults to 3&lt;br /&gt;
# if supported by client library)&lt;br /&gt;
ldap_version 3&lt;br /&gt;
&lt;br /&gt;
# The distinguished name to bind to the server with.&lt;br /&gt;
# Optional: default is to bind anonymously.&lt;br /&gt;
#binddn cn=proxyuser,dc=padl,dc=com&lt;br /&gt;
&lt;br /&gt;
# The credentials to bind with. &lt;br /&gt;
# Optional: default is no credential.&lt;br /&gt;
#bindpw secret&lt;br /&gt;
&lt;br /&gt;
# The distinguished name to bind to the server with&lt;br /&gt;
# if the effective user ID is root. Password is&lt;br /&gt;
# stored in /etc/ldap.secret (mode 600)&lt;br /&gt;
rootbinddn cn=admin,dc=iescalquera,dc=local&lt;br /&gt;
&lt;br /&gt;
# The port.&lt;br /&gt;
# Optional: default is 389.&lt;br /&gt;
#port 389&lt;br /&gt;
&lt;br /&gt;
# The search scope.&lt;br /&gt;
#scope sub&lt;br /&gt;
#scope one&lt;br /&gt;
#scope base&lt;br /&gt;
&lt;br /&gt;
# Search timelimit&lt;br /&gt;
#timelimit 30&lt;br /&gt;
&lt;br /&gt;
# Bind/connect timelimit&lt;br /&gt;
#bind_timelimit 30&lt;br /&gt;
&lt;br /&gt;
# Reconnect policy: hard (default) will retry connecting to&lt;br /&gt;
# the software with exponential backoff, soft will fail&lt;br /&gt;
# immediately.&lt;br /&gt;
#bind_policy hard&lt;br /&gt;
&lt;br /&gt;
# Idle timelimit; client will close connections&lt;br /&gt;
# (nss_ldap only) if the server has not been contacted&lt;br /&gt;
# for the number of seconds specified below.&lt;br /&gt;
#idle_timelimit 3600&lt;br /&gt;
&lt;br /&gt;
# Filter to AND with uid=%s&lt;br /&gt;
#pam_filter objectclass=account&lt;br /&gt;
&lt;br /&gt;
# The user ID attribute (defaults to uid)&lt;br /&gt;
#pam_login_attribute uid&lt;br /&gt;
&lt;br /&gt;
# Search the root DSE for the password policy (works&lt;br /&gt;
# with Netscape Directory Server)&lt;br /&gt;
#pam_lookup_policy yes&lt;br /&gt;
&lt;br /&gt;
# Check the &amp;#039;host&amp;#039; attribute for access control&lt;br /&gt;
# Default is no; if set to yes, and user has no&lt;br /&gt;
# value for the host attribute, and pam_ldap is&lt;br /&gt;
# configured for account management (authorization)&lt;br /&gt;
# then the user will not be allowed to login.&lt;br /&gt;
#pam_check_host_attr yes&lt;br /&gt;
&lt;br /&gt;
# Check the &amp;#039;authorizedService&amp;#039; attribute for access&lt;br /&gt;
# control&lt;br /&gt;
# Default is no; if set to yes, and the user has no&lt;br /&gt;
# value for the authorizedService attribute, and&lt;br /&gt;
# pam_ldap is configured for account management&lt;br /&gt;
# (authorization) then the user will not be allowed&lt;br /&gt;
# to login.&lt;br /&gt;
#pam_check_service_attr yes&lt;br /&gt;
&lt;br /&gt;
# Group to enforce membership of&lt;br /&gt;
#pam_groupdn cn=PAM,ou=Groups,dc=padl,dc=com&lt;br /&gt;
&lt;br /&gt;
# Group member attribute&lt;br /&gt;
#pam_member_attribute uniquemember&lt;br /&gt;
&lt;br /&gt;
# Specify a minium or maximum UID number allowed&lt;br /&gt;
#pam_min_uid 0&lt;br /&gt;
#pam_max_uid 0&lt;br /&gt;
&lt;br /&gt;
# Template login attribute, default template user&lt;br /&gt;
# (can be overriden by value of former attribute&lt;br /&gt;
# in user&amp;#039;s entry)&lt;br /&gt;
#pam_login_attribute userPrincipalName&lt;br /&gt;
#pam_template_login_attribute uid&lt;br /&gt;
#pam_template_login nobody&lt;br /&gt;
&lt;br /&gt;
# HEADS UP: the pam_crypt, pam_nds_passwd,&lt;br /&gt;
# and pam_ad_passwd options are no&lt;br /&gt;
# longer supported.&lt;br /&gt;
#&lt;br /&gt;
# Do not hash the password at all; presume&lt;br /&gt;
# the directory server will do it, if&lt;br /&gt;
# necessary. This is the default.&lt;br /&gt;
pam_password crypt&lt;br /&gt;
&lt;br /&gt;
# Hash password locally; required for University of&lt;br /&gt;
# Michigan LDAP server, and works with Netscape&lt;br /&gt;
# Directory Server if you&amp;#039;re using the UNIX-Crypt&lt;br /&gt;
# hash mechanism and not using the NT Synchronization&lt;br /&gt;
# service. &lt;br /&gt;
#pam_password crypt&lt;br /&gt;
&lt;br /&gt;
# Remove old password first, then update in&lt;br /&gt;
# cleartext. Necessary for use with Novell&lt;br /&gt;
# Directory Services (NDS)&lt;br /&gt;
#pam_password clear_remove_old&lt;br /&gt;
#pam_password nds&lt;br /&gt;
&lt;br /&gt;
# RACF is an alias for the above. For use with&lt;br /&gt;
# IBM RACF&lt;br /&gt;
#pam_password racf&lt;br /&gt;
&lt;br /&gt;
# Update Active Directory password, by&lt;br /&gt;
# creating Unicode password and updating&lt;br /&gt;
# unicodePwd attribute.&lt;br /&gt;
#pam_password ad&lt;br /&gt;
&lt;br /&gt;
# Use the OpenLDAP password change&lt;br /&gt;
# extended operation to update the password.&lt;br /&gt;
#pam_password exop&lt;br /&gt;
&lt;br /&gt;
# Redirect users to a URL or somesuch on password&lt;br /&gt;
# changes.&lt;br /&gt;
#pam_password_prohibit_message Please visit http://internal to change your password.&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configurar o cliente LDAP ==&lt;br /&gt;
&lt;br /&gt;
Agora teremos que configurar o equipo para que use a conexión co servidor LDAP que xa temos configurada para tomar os usuarios e grupos do sistema. Usaremos o comando &amp;#039;&amp;#039;auth-client-config&amp;#039;&amp;#039;:&lt;br /&gt;
 sudo auth-client-config -t nss -p lac_ldap&lt;br /&gt;
&lt;br /&gt;
Se visualizamos o ficheiro &amp;#039;&amp;#039;&amp;#039;/etc/nsswitch.conf&amp;#039;&amp;#039;&amp;#039; veremos que con este comando modificáronse as seguinte liñas:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
passwd:         files ldap&lt;br /&gt;
group:          files ldap&lt;br /&gt;
shadow:         files ldap&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
que lle di ao noso sistema que tome os usuarios en primeiro lugar dos ficheiros locais de usuarios e grupos, e a continuación do servidor LDAP.&lt;br /&gt;
&lt;br /&gt;
Por último, o comando &amp;#039;&amp;#039;&amp;#039;pam-auth-update&amp;#039;&amp;#039;&amp;#039; serve para indicar que servizos vai usar o sistema para autenticar os usuarios. Podemos executalo para comprobar que está xa activado o LDAP (polo que, en realidade, non hai por que executar este comando):&lt;br /&gt;
&lt;br /&gt;
 sudo pam-auth-update&lt;br /&gt;
&lt;br /&gt;
Podemos ver a continuación a pantalla que mostra este comando:&lt;br /&gt;
&lt;br /&gt;
[[Imagen:Platega_U910_Server_Configuracion_Cliente_LDAP8.png|500px]]&lt;br /&gt;
&lt;br /&gt;
== Probar o funcionamento do cliente ==&lt;br /&gt;
&lt;br /&gt;
Temos dúas formas sinxelas de comprobar que a configuración do cliente é correcta e toma realmente os usuarios do servidor:&lt;br /&gt;
* Usar o comando &amp;#039;&amp;#039;&amp;#039;getent passwd&amp;#039;&amp;#039;&amp;#039;: Este comando mostra pola pantalla todos os usuarios do sistema, tomándoos das diversas fontes que pode ter configuradas. No noso caso, deberían aparecer ao final os usuarios LDAP. A continuación pódese ver a última parte do resultado deste comando, no que aparece o usuario &amp;#039;&amp;#039;alfredo&amp;#039;&amp;#039; do LDAP:&lt;br /&gt;
 administrador:x:1000:1000:administrador,,,:/home/administrador:/bin/bash&lt;br /&gt;
 sshd:x:103:65534::/var/run/sshd:/usr/sbin/nologin&lt;br /&gt;
 openldap:x:104:112:OpenLDAP Server Account,,,:/nonexistent:/bin/false&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;alfredo:x:10000:10000:Alfredo Perez:/home/alfredo:/bin/bash&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Iniciar sesión no equipo cliente con un usuario do LDAP: Deberemos iniciar a sesión en modo de texto, &amp;#039;&amp;#039;&amp;#039;non en modo gráfico, iso verase na parte III do curso,&amp;#039;&amp;#039;&amp;#039; (utilizando por exemplo unha consola virtual, premendo nas teclas Control+Alt+F1, e poderemos volver ao contorno gráfico premendo Control+Alt+F7), xa que ao non existir no equipo cliente a carpeta persoal do usuario, se intentamos iniciar unha sesión en modo gráfico produciranse unha serie de erros impedirán o inicio de sesión (Solucionaremos este problema con &amp;#039;&amp;#039;NFS&amp;#039;&amp;#039; máis adiante).&lt;br /&gt;
&lt;br /&gt;
-- [[Usuario:antonio| Antonio de Andrés Lema]] e [[Usuario:Carrion| Carlos Carrión Álvarez]]&lt;/div&gt;</summary>
		<author><name>Carrion</name></author>
	</entry>
</feed>