Search code examples
ldapopensuse

How to restrict ldap logins to specific users in opensuse


I setup a little server and have it authenticating with ldap.. is there a way to restrict which ldap user can login via ssh without adding an account to the opensuse box?


Solution

  • 1 - Create a group on LDAP using YaST's User and Group Management, for instance "serveradmins". This will create a entry on your LDAP server under the group OU.

    2 - Add the allowed users to this group, also using YaST

    3 - On the servers you want to restrict the access, edit the /etc/ldap.conf, making sure the following instructions are present (uncommented), mind changing the DC= parts to your configuration:

    pam_groupdn cn=serveradmins,ou=group,dc=example,dc=com

    pam_member_attribute member

    Let me know if this worked well for you. I have this working on OpenSUSE and Ubuntu machines.