linux实现ldap账户分组登录

linux实现ldap账户分组登录

仅允许it组的用户访问该机器

vi /etc/pam.d/sshd

在最顶部添加

auth   [success=1 default=ignore]    pam_succeed_if.so user ingroup it

auth  requisite   pam_deny.so

 

确保 /etc/nsswitch.conf

group:files ldap

 

查看it组的用户

getent group it

systemctl restart sshd   

 

posted @ 2025-09-10 11:13  aaahwh  阅读(8)  评论(0)    收藏  举报