Hi all :) Currently migrating an old debian system (NIS, samba2 and a couple of other services), to a new machine mainly configured around LDAP, I needed some sort of access restriction, mainly to deny access to particular group of users on certain clients/servers. So, I created defined groups of users (like admins, printer-admins, and so on) in ldap, and decided to restrict their access using the pam_groupdn attribute in /etc/pam_ldap.conf file. However, it doesn't seem to work as intended. Authentication works, a "getent passwd" correctly adds users to the lists (using NSS), but for services like ssh, or login via terminal, even users that do not belong to the group defined by pam_groupdn attribute are still able to login. Here are the config files I'm working with. /etc/pam.d/ssh auth required /lib/security/pam_unix.so shadow nullok /etc/pam.d/pam_ldap.conf host 127.0.0.1 /etc/ssh/sshd_config Port 22 Nevertheless, when logging in, I still get a warning message indicating that the pam_groupdn attribute does work: bash-3.00$ ssh [EMAIL PROTECTED] As you can see, even when not belonging to the group, I still get access to the server. After testing multiple scenarios and options, I ended up with this line, where the pam_unix module seems to grant access to user, even when he's not in pam_groupdn group. Quoting it, or turning the control flag to sufficient, completely blocks authentification via ssh, for ldap users as for system users, like root. account required /lib/security/pam_unix.so That's all I noticed so far. I couldn't tell if the problem was coming from the pam_ldap or pam_unix libraries, or, more simple, a misconfiguration from me ^^ I know I could use some other user access restriction modules (like pam_wheel), but the pam_groupdn was really THE solution for my case. Having this configured directly into ldap, and using aliases for ipHost <> hostname, I could handle all the restriction directly from pam_ldap.conf, and do not necessarily need to edit all the pam.d/* files. Some googling brings up this problem elsewhere too: http://lists.debian.org/debian-user-french/2003/11/msg01094.html (2003, but seems to be the same problem as me) http://lists.freebsd.org/pipermail/freebsd-questions/2004-October/061443.html Right now, I'm stuck with it. If anybody notices some errors in my conf files, or got this to work properly, I'd be glad to know how they did. Thanking you in advance for any help you may bring :-) , Jean-Yves Migeon. |
- Problem with ldap/pam/ssh, pam_groudn attribute doesn't... Jean-Yves Migeon
- Re: Problem with ldap/pam/ssh, pam_groudn attribut... Roberto C. Sanchez
- Re: Problem with ldap/pam/ssh, pam_groudn attr... Jean-Yves Migeon
- Re: Problem with ldap/pam/ssh, pam_groudn attribut... Jean-Yves Migeon