インストールnslcdサービス
yumのNSS-PAM-ldapdをインストール
設定ファイルを変更します。viの/etc/nslcd.conf
値を変更し、ベースURI LDAPは、あなたのアドレスとユーザー名を変更
我々が/etc/pam.d/system-auth
1)在auth required pam_deny.so这行上面加上"auth sufficient pam_ldap.so use_first_pass"
2)在account required pam_permit.so这行上面加上account [default=bad success=ok user_unknown=ignore] pam_ldap.so
3)在password required pam_deny.so这行上面加上password sufficient pam_ldap.so use_authtok
4)在最后一行加上session optional pam_ldap.so
5)在session块中的第二行下面添加session optional pam_mkhomedir.so skel=/etc/skel/ umask=0022
注:pam_sss.soを含む行をコメントアウトするには
エディタのvi /etc/nsswitch.confの追加LDAP
passwdの:ファイルのldap
影:ファイル、LDAP
グループ:ファイル、LDAP
编辑の/ etc /のsysconfig /にauthconfig
确保:
USESHADOW=yes
USELDAPAUTH=yes
USELOCAUTHORIZE=yes
USELDAP=yes
編集は、/ etc / ssh / sshd_configファイルの閲覧はいUsePAMを確保され
編集/etc/pam.d/sshd
1)在最后面添加session required pam_mkhomedir.so
2)在account块中添加account required pam_access.so(后续控制用户使用)
編集/etc/pam.d/password-auth
1)auth块中倒数第二行添加auth sufficient pam_ldap.so use_first_pass
2)account块中倒数第二行添加account [default=bad success=ok user_unknown=ignore] pam_ldap.so
3)password块中倒数第二行添加password sufficient pam_ldap.so use_authtok
4)session块中最后一行添加session optional pam_ldap.so
注:行が含まれていpam_sss.so注釈
サービスの再起動
systemctl再起動sshdを
systemctl再起動nslcd
オリジナル住所
https://www.cnblogs.com/cy0917/p/10178898.html
https://blog.csdn.net/weixin_33774883/article/details/89783044