linux conectandose a Dominio de Samba

Iniciado por patillotes, Febrero 17, 2012, 10:53:36 AM

Tema anterior - Siguiente tema

patillotes

A las buenas. Tenemos un dominio hecho con Samba, ignoro como esta por dentro, pero supongo que bien. Asumo que es de los antiguos (no Active Directoru)

Quiero conectar un cliente linux (lliurex aprox. igual a Ubuntu) a el.

Cosas hechas

/etc/samba/smb.conf
-------------------------------
[global]
   workgroup = CENTRO
   server string = %h server (Samba, Ubuntu)
   dns proxy = no
   security = domain
   password server = fsserver
   netbiosname = testudo
   log file = /var/log/samba/log.%m
   max log size = 1000
   syslog = 0
   panic action = /usr/share/samba/panic-action %d
winbind separator = .
   encrypt passwords = true
   passdb backend = tdbsam
   obey pam restrictions = yes
   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
   pam password change = yes
   map to guest = bad user
   idmap uid = 10000-20000
   idmap gid = 10000-20000
   template homedir = /home/%U
   template shell = /bin/bash
   winbind enum groups = yes
   winbind enum users = yes
   winbind use default domain = yes
   usershare allow guests = yes
[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700
[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no

------------
Tras esto  recargo el demonio de winbind y me uno al dominio sin problemas quicir:

net rpc join -S fsserver -U joindomain
wbinfo -t
.............->checking the trust secret via RPC calls succeeded
wbinfo -u
(El mogollon de usuarios)
wbinfo -g
(El mogollon de grupos)

---------------------
Quicir, estoy dentro del dominio. Vale, ahora quiero autenticarme en el el

vi /etc/nsswitch.conf
-------------------------------
passwd:         files winbind
group:          files winbind
shadow:         files

hosts:          files dns winbind
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis
---------

Como prueba:
getenpt passwd
(el mogollon de usuarios)

-----------
Ahora voy a por el pam para poderme autenticar (dejando los usuarios locales como fallback)

vi /etc/pam.d/common-auth
----------------
auth    sufficient      pam_winbind.so
auth    required        pam_unix.so use_first_pass

vi /etc/pam.d/common-account
------------------------------------
account sufficient      pam_winbind.so
account required        pam_unix.so use_first_pass


vi /etc/pam.d/common-session
--------------------------------------
session [default=1]                     pam_permit.so
session required        pam_unix.so
session required                        pam_mkhomedir.so silent
session optional                        pam_winbind.so

vi /etc/pam.d/common-password
---------------------------
password        [success=2 default=ignore]      pam_unix.so obscure sha512
password        [success=1 default=ignore]      pam_winbind.so use_authtok try_first_pass

-------------
Y el caso es que no funciona

id usuario
(falla)
------------

Si intento hacer login (ya sea por login de linea de comandos o gdm) hace unos cuantos pasos pero peta al final

Mirando el /var/log/auth.log se ven errores de este estilo al intentar conectar un usuario miembro del dominio
---------------------------
Feb 17 10:44:03 lliurex login[14079]: pam_unix(login:account): could not identify user (from getpwnam(usuario))
Feb 17 10:44:03 lliurex login[14079]: User not known to the underlying authentication module
-------------

Probando con contraseñas erroneas el pam_winbind me enseña el dedo, quicir, se autentica contra el dominio y luego el cabron de pam_unix me manda a cagar en la fase/comosellame de account.

He probado a dejar pelado el /etc/pam.d/login
-------------
@include common-auth
@include common-account
@include common-session
@include common-password
-----------------

Y nada, el mismo puto error.

¿Sugerencias?





# Lo he dejado asi de pelado y nada, no hay tu tia

patillotes

Vale incidencia cerrada. Esta en la wiki de Samba, hay que matar al nscd:

http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/winbind.html
Winbind Is Not Resolving Users and Groups

“ My smb.conf file is correctly configured. I have specified idmap uid = 12000, and idmap gid = 3000-3500 and winbind is running. When I do the following, it all works fine. ”

root# wbinfo -u
MIDEARTH\maryo
MIDEARTH\jackb
MIDEARTH\ameds
...
MIDEARTH\root

root# wbinfo -g
MIDEARTH\Domain Users
MIDEARTH\Domain Admins
MIDEARTH\Domain Guests
...
MIDEARTH\Accounts

root# getent passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/bin/bash
...
maryo:x:15000:15003:Mary Orville:/home/MIDEARTH/maryo:/bin/false

“ But the following command just fails: ”

root# chown maryo a_file
chown: `maryo': invalid user

“ This is driving me nuts! What can be wrong? ”

Same problem as the one above. Your system is likely running nscd, the name service caching daemon. Shut it down, do not restart it! You will find your problem resolved. Alternately, fix the operation of nscd to resolve the problem.