Instale o LDAP no Ubuntu 14.04

2

Estou tentando configurar o OpenLDAP no Ubuntu Server 14.04 LTS e Clients (Ubuntu 14.04 e / ou Linux Mint 17). Ele funciona com o comando su, ssh ou no terminal, mas não funciona na tela de login. Logo após a instalação, posso ver os usuários do LDAP na tela de login, mas depois de alguns minutos, apenas os usuários locais estão disponíveis. /var/log/auth.log me dê:

Feb 17 21:33:50 PC1 sh: nss_ldap: could not connect to any LDAP server as cn=admin,dc=example,dc=local - Can't contact LDAP server
Feb 17 21:33:50 PC1 sh: nss_ldap: failed to bind to LDAP server ldap://192.168.0.22: Can't contact LDAP server
Feb 17 21:33:50 PC1 sh: nss_ldap: reconnecting to LDAP server...
Feb 17 21:33:50 PC1 sh: nss_ldap: could not connect to any LDAP server as cn=admin,dc=example,dc=local - Can't contact LDAP server
Feb 17 21:33:50 PC1 sh: nss_ldap: failed to bind to LDAP server ldap://192.168.0.22: Can't contact LDAP server
Feb 17 21:33:50 PC1 sh: nss_ldap: reconnecting to LDAP server (sleeping 1 seconds)...
Feb 17 21:33:51 PC1 sh: nss_ldap: could not connect to any LDAP server as cn=admin,dc=example,dc=local - Can't contact LDAP server
Feb 17 21:33:51 PC1 sh: nss_ldap: failed to bind to LDAP server ldap://192.168.0.22: Can't contact LDAP server
Feb 17 21:33:51 PC1 sh: nss_ldap: could not search LDAP server - Server is unavailable
Feb 17 21:33:51 PC1 sh: nss_ldap: could not connect to any LDAP server as cn=admin,dc=example,dc=local - Can't contact LDAP server
Feb 17 21:33:51 PC1 sh: nss_ldap: failed to bind to LDAP server ldap://192.168.0.22: Can't contact LDAP server
Feb 17 21:33:51 PC1 sh: nss_ldap: reconnecting to LDAP server...
Feb 17 21:33:51 PC1 sh: nss_ldap: could not connect to any LDAP server as cn=admin,dc=example,dc=local - Can't contact LDAP server
Feb 17 21:33:51 PC1 sh: nss_ldap: failed to bind to LDAP server ldap://192.168.0.22: Can't contact LDAP server
Feb 17 21:33:51 PC1 sh: nss_ldap: reconnecting to LDAP server (sleeping 1 seconds)...
Feb 17 21:33:52 PC1 sshd[968]: Server listening on 0.0.0.0 port 22.
Feb 17 21:33:52 PC1 sshd[968]: Server listening on :: port 22.
Feb 17 21:33:52 PC1 lightdm: PAM unable to dlopen(pam_kwallet.so): /lib/security/pam_kwallet.so: cannot open shared object file: No such file or directory
Feb 17 21:33:52 PC1 lightdm: PAM adding faulty module: pam_kwallet.so
Feb 17 21:33:52 PC1 lightdm: pam_unix(lightdm-greeter:session): session opened for user lightdm by (uid=0)
Feb 17 21:33:52 PC1 lightdm: PAM unable to dlopen(pam_kwallet.so): /lib/security/pam_kwallet.so: cannot open shared object file: No such file or directory
Feb 17 21:33:52 PC1 lightdm: PAM adding faulty module: pam_kwallet.so
Feb 17 21:33:52 PC1 lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "adminlocal"
Feb 17 21:33:52 PC1 sh: nss_ldap: could not connect to any LDAP server as cn=admin,dc=example,dc=local - Can't contact LDAP server
Feb 17 21:33:52 PC1 sh: nss_ldap: failed to bind to LDAP server ldap://192.168.0.22: Can't contact LDAP server
Feb 17 21:33:52 PC1 sh: nss_ldap: could not search LDAP server - Server is unavailable
Feb 17 21:33:54 PC1 dbus[431]: [system] Rejected send message, 7 matched rules; type="method_return", sender=":1.42" (uid=0 pid=1518 comm="/usr/sbin/dnsmasq --no-resolv --keep-in-foreground") interface="(un$
Feb 17 21:34:04 PC1 dbus[431]: [system] Rejected send message, 7 matched rules; type="method_return", sender=":1.42" (uid=0 pid=1518 comm="/usr/sbin/dnsmasq --no-resolv --keep-in-foreground") interface="(un$
Feb 17 21:34:18 PC1 sshd[1728]: Accepted password for adminlocal from 192.168.0.53 port 61914 ssh2
Feb 17 21:34:18 PC1 sshd[1728]: pam_unix(sshd:session): session opened for user adminlocal by (uid=0)
Feb 17 21:34:44 PC1 sudo: pam_unix(sudo:auth): authentication failure; logname=adminlocal uid=1000 euid=0 tty=/dev/pts/1 ruser=adminlocal rhost=  user=adminlocal
Feb 17 21:34:49 PC1 sudo: adminlocal : TTY=pts/1 ; PWD=/home/adminlocal ; USER=root ; COMMAND=/usr/bin/nano /var/log/nscd.log
Feb 17 21:34:49 PC1 sudo: pam_unix(sudo:session): session opened for user root by adminlocal(uid=0)
Feb 17 21:34:51 PC1 sudo: pam_unix(sudo:session): session closed for user root

Getent passwd me mostre os usuários do ldap, então acho que isso é um problema do lightdm ... Eu tentei vários guias, sem sucesso. Existe alguém na mesma situação? O que eu posso fazer ? Muito obrigado. Florent

Etapa para reproduzir

Corrigir IP estático:

sudo nano /etc/network/interfaces
[…]
auto eth0
iface eth0 inet static
address 192.168.0.22
network 192.168.0.0
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.254
dns-nameservers 8.8.8.8

Instalar o LDAP

sudo apt-get install slapd ldap-utils
sudo dpkg-reconfigure slapd

Não

example.com

Exemplo de empresa

senha x2

HDB, Não, Sim, Não (valores padrão)

Instale o phpldapadmin (também tentei com arquivos ldif)

sudo apt-get install phpldapadmin


sudo nano /etc/phpldapadmin/config.php
[line 161]
$config->custom->appearance['hide_template_warning'] = true;
[...]
$servers->setValue('server','host','192.168.0.22');
[...]
$servers->setValue('server','base',array('dc=aldarim,dc=local'));
[...]
$servers->setValue('login','bind_id','cn=admin,dc=aldarim,dc=local');


sudo nano /usr/share/phpldapadmin/lib/TemplateRender.php 
[Line 2469]
$default = $this->getServer()->getValue('appearance','password_hash_custom');

Configurar o LDAP

link

  • Tornar 2 genérico: unidade organizacional = > Grupos & amp; Pessoas
  • Em Grupos, faça 2 grupos Posix = > admin & amp; funcionários
  • Em Pessoas, faça os usuários

Instale o cliente ldap no servidor

sudo apt-get install libpam-ldap nscd

ldap: //127.0.0.1

dc = exemplo, dc = com

3, Sim, Não (valores padrão)

cn = admin, dc = exemplo, dc = com

senha do administrador

nano /etc/nsswitch.conf
[...]
passwd:         compat ldap
group:          compat ldap
shadow:         compat ldap
[...]

sudo reboot

Configuração do cliente

sudo apt-get install libpam-ldap nscd

ldap: //192.168.0.22

dc = exemplo, dc = com

3, Sim, Não (valores padrão)

cn = admin, dc = exemplo, dc = com

senha do administrador

nano /etc/nsswitch.conf
[...]
passwd:         compat ldap
group:          compat ldap
shadow:         compat ldap
[...]

sudo reboot    

Configuração alternativa do cliente:

sudo apt-get install libnss-ldap ldap-auth-config
sudo auth-client-config -t nss -p lac_ldap
sudo pam-auth-update

Mesmos erros ...

    
por Kobrasnip 18.02.2015 / 21:10

1 resposta

1

O problema está nas diferenças com sua configuração. O dc deve corresponder ao domínio example.com , mas no phpldapadmin você configurou o dc como aldarim.local . Aqui estão as suas configurações:

Configuração do LDAP:

  • Não
  • example.com
  • Exemplo de empresa
  • senha x2
  • HDB, Não, Sim, Não (valores padrão)

e configuração do phpldapadmin:

sudo nano /etc/phpldapadmin/config.php
[line 161]
$config->custom->appearance['hide_template_warning'] = true;
[...]
$servers->setValue('server','host','192.168.0.22');
[...]
$servers->setValue('server','base',array('dc=aldarim,dc=local'));
[...]
$servers->setValue('login','bind_id','cn=admin,dc=aldarim,dc=local');

Aqui está um exemplo de como o domínio deve corresponder, mesmo se você usar o endereço IP: Veja este tutorial que lhe dá a ideia de que você pode digitar o que quiser, mas as duas configurações DEVEM corresponder.

Altere sua configuração LDAP para usar aldarim.local e chame a empresa aldarim e você deve estar ok. Ou altere as seguintes linhas para usar example.com

$servers->setValue('server','base',array('dc=example,dc=com'));
[...]
$servers->setValue('login','bind_id','cn=admin,dc=example,dc=com');

Em qualquer caso, eles precisam corresponder.

    
por kizmox 05.08.2017 / 16:58