可以使用以下过程将 RHEL 8.x 桌面与 Active Directory (AD) 域相集成,以便进行智能卡重定向。
该过程中的一些示例使用占位符值以表示网络配置中的实体,例如,AD 域的 DNS 名称。请将占位符值替换为您的配置特定的信息,如下表中所述。
占位符值 |
描述 |
dns_IP_ADDRESS |
DNS 名称服务器的 IP 地址 |
rhel8sc.rzview2.com |
RHEL 8.0 系统的完全限定主机名 |
rhel8sc |
RHEL 8.0 系统的非限定主机名 |
rzview2.com |
AD 域的 DNS 名称 |
RZVIEW2.COM |
AD 域的 DNS 名称,全部为大写字母 |
RZVIEW2 |
包含 Samba 服务器的工作组或 NT 域的 DNS 名称,全部为大写字母 |
rzviewdns.rzview2.com |
AD 服务器的主机名 |
过程
- 在 RHEL 8.x 系统上,执行以下操作。
- 根据组织要求配置网络和 DNS 设置。
- 禁用 IPv6。
- 禁用自动 DNS。
- 配置 /etc/hosts 配置文件,使其类似于以下示例。
127.0.0.1 rhel8sc.rzview2.com rhel8sc localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
dns_IP_ADDRESS rzviewdns.rzview2.com
- 配置 /etc/resolv.conf 配置文件,使其类似于以下示例。
# Generated by NetworkManager
search rzview2.com
nameserver dns_IP_ADDRESS
- 安装 AD 集成所需的软件包。
# yum install -y samba-common-tools oddjob-mkhomedir
- 启用 oddjobd 服务。
# systemctl enable oddjobd.service
# systemctl start oddjobd.service
- 指定系统身份和身份验证源。
# authselect select sssd with-smartcard with-mkhomedir
- 启动 oddjobd 服务。
# systemctl enable oddjobd.service
# systemctl start oddjobd.service
- 要支持智能卡身份验证,请创建 /etc/sssd/sssd.conf 文件。
# touch /etc/sssd/sssd.conf
# chmod 600 touch /etc/sssd/sssd.conf
# chown root:root /etc/sssd/sssd.conf
- 将所需内容添加到 /etc/sssd/sssd.conf 中,如以下示例中所示。在 [pam] 部分下,指定 pam_cert_auth = True。
[sssd]
config_file_version = 2
domains = rzview2.com
services = nss, pam, pac
[domain/RZVIEW2.COM]
id_provider = ad
auth_provider = ad
chpass_provider = ad
access_provider = ad
cache_credentials = true
[pam]
pam_cert_auth = True
- 启用 sssd 服务。
# systemctl enable sssd.service
# systemctl start sssd.service
- 编辑 /etc/krb5.conf 配置文件,使其类似于以下示例。
# To opt out of the system crypto-policies configuration of krb5, remove the
# symlink at /etc/krb5.conf.d/crypto-policies which will not be recreated.
includedir /etc/krb5.conf.d/
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
[libdefaults]
dns_lookup_realm = false
ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true
rdns = false
pkinit_anchors = /etc/pki/tls/certs/ca-bundle.crt
spake_preauth_groups = edwards25519
default_realm = RZVIEW2.COM
default_ccache_name = KEYRING:persistent:%{uid}
[realms]
RZVIEW2.COM = {
kdc = rzviewdns.rzview2.com
admin_server = rzviewdns.rzview2.com
default_domain = rzviewdns.rzview2.com
pkinit_anchors = FILE:/etc/pki/nssdb/certificate.pem
pkinit_cert_match = <KU>digitalSignature
pkinit_kdc_hostname = rzviewdns.rzview2.com
}
[domain_realm]
.rzview2.com = RZVIEW2.COM
rzview2.com = RZVIEW2.COM
- 编辑 /etc/samba/smb.conf 配置文件,使其类似于以下示例。
[global]
workgroup = RZVIEW2
security = ads
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw
password server = rzviewdns.rzview2.com
realm = RZVIEW2.COM
idmap config * : range = 16777216-33554431
template homedir =/home/RZVIEW2/%U
template shell = /bin/bash
kerberos method = secrets and keytab
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes
[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No
[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @printadmin root
force group = @printadmin
create mask = 0664
directory mask = 0775
- 加入 AD 域,如以下示例中所示。
# net ads join -U AdminUser
运行
join 命令将返回类似于以下示例的输出。
Enter AdminUser's password:
Using short domain name -- RZVIEW2
Joined 'RHEL8SC' to dns domain 'rzview2.com'
- 确认 RHEL 8.x 桌面已成功加入 AD 域。
# net ads testjoin
Join is OK