Respective first install dependencies;
yum install sssd realmd oddjob oddjob-mkhomedir adcli samba-common samba-common-tools krb5-workstation openldap-clients policycoreutils-python ntp –y
AD resolve to ensure the normal editing /etc/resolv.conf file;
[root@@testLinux-WH ~]# cat /etc/resolv.conf
search example.com
nameserver 192.168.10.51
To ensure that the account has the appropriate permissions, was added AD domain;
[root@@testLInux-WH ~]# realm join --user=administrator example.com
Password for administrator:
If the error can use the command journalctl -xe REALMD_OPERATION = r549.7056 plus an error code to view the information being given. Confirm normal DNS resolution, verify that the same time;
ntpdate ntpserver
Use realm list to confirm realm of information;
[root@@testLinux-WH ~]# realm list
example.com
type: kerberos
realm-name: EXAMPLE.COM
domain-name: example.com
configured: kerberos-member
server-software: active-directory
client-software: sssd
required-package: oddjob
required-package: oddjob-mkhomedir
required-package: sssd
required-package: adcli
required-package: samba-common-tools
login-formats: %[email protected]
login-policy: allow-realm-logins
加域成功后,AD中自动创建了相关记录;
由于CentOS中默认使用完整用户名“[email protected]”,需要修改 /etc/sssd/sssd.conf 配置文件来达到使用短用户名的目的;
use_fully_qualified_names = False
fallback_homedir = /home/%u
重启服务使其生效;
systemctl restart sssd
尝试使用测试账户连接;
[email protected]'s password:
Creating home directory for fei-u031.
Last failed login: Wed Aug 7 15:52:22 CST 2019 from adsvr01.example.com on ssh:notty
There were 4 failed login attempts since the last successful login.
/usr/bin/xauth: file /home/fei-u031/.Xauthority does not exist
[fei-u031@testLinux-WH ~]$ pwd
/home/fei-u031
退出AD域;
realm leave example.com