Centos7 使用AD认证

1、AD用户linux属性添加:

需要增加的属性如下:

gidNumber(linux属组)、  loginShell(登录shell)、  uid(用户名)、  uidNumber、 unixHomeDirectory(home目录路径)

2、安装nss-pam-ldapd 组件:

yum install nss-pam-ldapd -y

3、修改客户端配置文件:

authconfig --enablemkhomedir \
--disableldaptls \
--enablemd5 \
--enableldap \
--enableldapauth \
--ldapserver=ldap://AD ip 地址 \
--ldapbasedn="dc=demo,dc=com" \
--enableshadow \
--update


cat >> /etc/nslcd.conf << EOF
        binddn cn=administrator,cn=Users,dc=demo,dc=com
        bindpw 密码
        pagesize 1000
        referrals off
        filter passwd (&(objectClass=user)(!(objectClass=computer))(unixHomeDirectory=*))
        map    passwd homeDirectory    unixHomeDirectory
        filter shadow (&(objectClass=user)(!(objectClass=computer))(unixHomeDirectory=*))
        map    shadow shadowLastChange pwdLastSet
        filter group  (objectClass=group)
EOF
sed -i s/sss/ldap/g /etc/nsswitch.conf
sed -i s/pam_sss/pam_ldap/g /etc/pam.d/system-auth
sed -i s/pam_sss/pam_ldap/g /etc/pam.d/password-auth
sed -i s/pam_sss/pam_ldap/g /etc/pam.d/password-auth-ac

4、启动服务:

systemctl start nslcd

systemctl enable nslcd

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值