我正在尝试将 LDAP 登录限制为“admin”组。
这是我的 /etc/sssd/sssd.conf 文件:
[domain/default]
autofs_provider = ldap
ldap_tls_reqcert = allow
auth_provider = ldap
ldap_id_use_start_tls = False
chpass_provider = ldap
cache_credentials = True
debug_timestamps = True
ldap_default_authtok_type = password
ldap_search_base = dc=example,dc=com
id_provider = ldap
ldap_default_bind_dn = cn=moderator,ou=moderators,ou=test,o=organization,dc=example,DC=COM
min_id = 100
ldap_uri = ldaps://example.com:636/
ldap_default_authtok = Pa$$word
ldap_tls_cacertdir = /etc/openldap/cacerts/
ldap_tls_cert = /etc/openldap/cacerts/certificate.pem
access_provider = ldap
ldap_access_filter = memberOf=cn=admin,ou=group,o=organization,dc=example,dc=com
[sssd]
services = nss, pam, autofs
domains = default
[nss]
homedir_substring = /home
[pam]
[sudo]
[autofs]
[ssh]
[pac]
[ifp]
[secrets]
[session_recording]
我已经尝试过id username
,它提出了:
id user uid=90514(user) gid=20000(users) groups=20000(users),2480(admin)
当尝试通过这样做来更改用户时,输入密码后su user
会出错su: Permission denied
。从 sssd.conf 中删除组限制条目时,它按预期工作并允许用户登录。
有什么想法我搞砸了吗?
编辑:现在我将使用/etc/security 和 PAM进行设置,这样就可以了。但是我仍然对使用 sssd 进行操作感到好奇。