| INSTALACIÓN FÍSICA Y LÓGICA DE UNA RED CABLEADA E INALÁMBRICA EN UN AULA: | ||
|---|---|---|
| Anterior | Capítulo 24. Configuración LDAP | Siguiente |
La idea es que los usuarios se loguen desde cualquier máquina, mediante su, login y gdm, frente al servidor LDAP y tengan siempre el mismo entorno, a saber, variables de sistema, shell, escritorio etc
Simplemente realizamos los siguientes cambios:
HOST 192.168.4.1 BASE dc=esi, dc=es URI ldap://ldap.esi.es:666 |
NSS (Name Service Switch) es una característica de los sistemas UNIX que permite obtener información sobre nomebres de hosts, contraseñas, usuarios, alias de correo e información sobre los usuarios a partir de distintas fuentes de información, por exemplo sistema local, de un servidor NIS, de servidor DNS o LDAP.
La idea es realizar autenticación LDAP a través de la búsqueda en nsswitch. Para que el cliente pueda realizar autenticación LDAP. hemos de instalar libnss_ldap, configurar libnss_ldap.conf y /etc/nsswitch.conf
libnss-ldap espera que las cuentas sean objetos con los siguientes atributos: uid, uidNumber, gidNumber, homeDirectory, y loginShell. Estos atributos son permitidas por el objectClass posixAccount.
apt-get install libnss-ldap |
# Your LDAP server. Must be resolvable without using LDAP. # Multiple hosts may be specified, each separated by a # space. How long nss_ldap takes to failover depends on # whether your LDAP client library supports configurable # network or connect timeouts (see bind_timelimit). host 192.168.4.1 # The distinguished name of the search base. base dc=esi,dc=es # The LDAP version to use (defaults to 3 # if supported by client library) ldap_version 3 # The distinguished name to bind to the server with # if the effective user ID is root. Password is # stored in /etc/ldap.secret (mode 600) rootbinddn cn=manager,dc=esi,dc=es # Do not hash the password at all; presume # the directory server will do it, if # necessary. This is the default. pam_password md5 |
Indica el orden de búsqueda de los ficheros passwd, group, shadow.
passwd: files ldap group: files ldap shadow: files ldap |
Configuraremos PAM para permitir la autorización con LDAP. Para ello instalamos al paquete libpam-ldap, libpam-modules y configuramos el fichero /etc/pam_ldap.conf y las autenticaciones correspondientes en los módulos pam.d
pam_ldap permite hacer uso de un servidor LDAP para la autentificación de usuarios (comprobación de claves) a aquellas aplicaciones que utilicen PAM.
libpam-ldap asume que las cuentas son objetos con los siguientes atributos: uid y userPassword. Los atributos son soportado por el objectClass posixAccount.
apt-get install libpam-ldap libpam-modules |
# network or connect timeouts (see bind_timelimit). host 192.168.4.1 # The distinguished name of the search base. base dc=esi,dc=es ... # if supported by client library) ldap_version 3 # The distinguished name to bind to the server with # if the effective user ID is root. Password is # stored in /etc/pam_ldap.secret (mode 600) rootbinddn cn=manager,dc=esi,dc=es # Do not hash the password at all; presume # the directory server will do it, if # necessary. This is the default. pam_password md5 |
Los módulos se encuentran en /etc/pam.d
common-auth
auth required pam_unix.so nullok_secure |
common-account
account required pam_unix.so |
common-passwdord
password required pam_unix.so nullok obscure min=4 max=8 md5 # Alternate strength checking for password. Note that this # requires the libpam-cracklib package to be installed. # You will need to comment out the password line above and # uncomment the next two in order to use this. # (Replaces the `OBSCURE_CHECKS_ENAB', `CRACKLIB_DICTPATH') # # password required pam_cracklib.so retry=3 minlen=6 difok=3 # password required pam_unix.so use_authtok nullok md5 |
common-session
session required pam_unix.so session optional pam_foreground.so |
passwd
@include common-password |
gdm
#%PAM-1.0 auth requisite pam_nologin.so auth required pam_env.so @include common-auth @include common-account session required pam_limits.so @include common-session @include common-password |
login es la que vienen por defecto
auth requisite pam_securetty.so auth requisite pam_nologin.so session required pam_env.so readenv=1 # Standard Un*x authentication. @include common-auth auth optional pam_group.so # Standard Un*x account and session @include common-account @include common-session session optional pam_motd.so session optional pam_mail.so standard @include common-password |
su es la que vienen por defecto
Comprobar que accedemos al directorio con ldapserch
getent passwd getent group |
#Instalando libpam-dotfile apt-get install libpam-dotfile |
#Comando pamtest pamtest usuarios for service servicio pamtest passwd morgado Trying to authenticate morgado for service passwd. Password:[Clave del usuario] Authentication successful. pamtest login morgado Trying to authenticate morgado for service login. Password: Authentication successful |