Probleme d'accès host après configuration LDAP

bayefalle Messages postés 148 Statut Membre -  
mamiemando Messages postés 33228 Date d'inscription   Statut Modérateur Dernière intervention   -
Bonjour,

j'ai configuré LDAP sur un serveur linux et un client ubuntu. Après avoir touché les fichiers common-auth et common-account, ma machine ne reconnait plus le mot de passe. S'il vous plait aidez-moi à accéder dans ma machine client.

1 réponse

  1. mamiemando Messages postés 33228 Date d'inscription   Statut Modérateur Dernière intervention   7 944
     
    Bonjour,

    Effectivement avoir bidouillé les fichiers de configuration pam explique ton problème. Il faut toujours backuper ces fichiers quand tu y touches pour régler plus facilement ce genre de problème (ou te souvenir de comment ils étaient initialement).

    1) Démarre sur un live-CD ou USB (par exemple ce qui t'a permis d'installer ubuntu) pour lancer un terminal.

    2) Monte ta partition / dans un répertoire vide (par exemple /mnt/linux). Je suppose que c'est /dev/sda1. Nous allons reconstruire dans ce répertoire l'arborescence que tu as quand tu démarres normalement puis déplacer / à ce niveau (chroot) pour que les commandes que tu tapes ensuite aient la même signification que si tu avais démarré normalement.

    sudo -s
    mkdir -p /mnt/linux
    mount -t ext4 /dev/sda1 /mnt/linux
    mount -o bind /dev /mnt/linux/dev
    chroot /mnt/linux
    mount -t proc proc /proc
    mount -t sysfs none /sys


    3) Maintenant tout ce passe dans ce terminal comme si tu avais démarré normalement (on n'a juste pas monté /home, mais on n'en a pas besoin). Partant de là deux stratégies :

    - tu te souviens de ce que tu as fait dans ces fichiers => tu les corriges avec ton éditeur texte favori (ex :
    nano /etc/pam.d/common-account
    ). Depuis un autre terminal il faudrait éditer
    /mnt/linux/etc/pam.d/common-account
    . Note que si c'est juste modifier ces fichiers on aurait pu utiliser cette seconde commande directement après avoir monté /mnt/linux et ignoré ce qui suivait.

    - tu ne sais plus et on réinstalle pam

    apt-get update
    apt-get --reinstall $(dpkg -l | grep ^ii | cut -d" " -f3 | grep libpam)


    4) Vérifie que les fichiers impactés ont été corrigés. Si ce n'est pas le cas corrige-les à la main. Au cas où ça peut t'aider voici ce qu'ils contiennent chez moi sous debian :

    /etc/pam.d/common-auth

    #
    # /etc/pam.d/common-auth - authentication settings common to all services
    #
    # This file is included from other service-specific PAM config files,
    # and should contain a list of the authentication modules that define
    # the central authentication scheme for use on the system
    # (e.g., /etc/shadow, LDAP, Kerberos, etc.).  The default is to use the
    # traditional Unix authentication mechanisms.
    #
    # As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
    # To take advantage of this, it is recommended that you configure any
    # local modules either before or after the default block, and use
    # pam-auth-update to manage selection of other modules.  See
    # pam-auth-update(8) for details.
    
    # here are the per-package modules (the "Primary" block)
    auth    [success=1 default=ignore]      pam_unix.so nullok_secure
    # here's the fallback if no module succeeds
    auth    requisite                       pam_deny.so
    # prime the stack with a positive return value if there isn't one already;
    # this avoids us returning an error just because nothing sets a success code
    # since the modules above will each just jump around
    auth    required                        pam_permit.so
    # and here are more per-package modules (the "Additional" block)
    auth    optional                        pam_cap.so 
    # end of pam-auth-update config


    /etc/pam.d/common-account

    #
    # /etc/pam.d/common-account - authorization settings common to all services
    #
    # This file is included from other service-specific PAM config files,
    # and should contain a list of the authorization modules that define
    # the central access policy for use on the system.  The default is to
    # only deny service to users whose accounts are expired in /etc/shadow.
    #
    # As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
    # To take advantage of this, it is recommended that you configure any
    # local modules either before or after the default block, and use
    # pam-auth-update to manage selection of other modules.  See
    # pam-auth-update(8) for details.
    #
    
    # here are the per-package modules (the "Primary" block)
    account [success=1 new_authtok_reqd=done default=ignore]        pam_unix.so 
    # here's the fallback if no module succeeds
    account requisite                       pam_deny.so
    # prime the stack with a positive return value if there isn't one already;
    # this avoids us returning an error just because nothing sets a success code
    # since the modules above will each just jump around
    account required                        pam_permit.so
    # and here are more per-package modules (the "Additional" block)
    # end of pam-auth-update config


    5) Quitte proprement, puis redémarre normalement (sans live CD) :

    umount /sys
    umount /proc
    exit
    umount /mnt/linux/dev
    umount /mnt/linux/dev
    reboot


    Bonne chance
    0