nss_ad 模块要求 Oracle Solaris 客户机使用 DNS 进行主机解析。
有关说明,请参见如何启用 DNS 客户机。
如果同时指定了这两个指令,将优先考虑最后指定的那个指令。这是 idmap 自动搜索功能正常工作所必需的。
在下面的示例中,dig 命令验证是否可以通过使用 AD 服务器的名称和 IP 地址来解析该服务器。
# dig -x 192.168.11.22 +short myserver.ad.example # dig myserver.ad.example +short 192.168.11.22
# svccfg -s svc:/system/name-service/switch svc:/system/name-service/switch> setprop config/host = astring: "files dns" svc:/system/name-service/switch> select system/name-service/switch:default svc:/system/name-service/switch:default> refresh svc:/system/name-service/switch:default> quit
例如:
# svcs svc:/network/dns/client STATE STIME FMRI online Oct_14 svc:/network/dns/client:default
例如:
# /usr/sbin/kclient -T ms_ad
# svccfg -s svc:/system/name-service/switch svc:/system/name-service/switch> setprop config/password = astring: "files nis ad" svc:/system/name-service/switch> setprop config/group = astring: "files nis ad" svc:/system/name-service/switch> select system/name-service/switch:default svc:/system/name-service/switch:default> refresh svc:/system/name-service/switch:default> quit
# svcadm enable idmap
# svcadm refresh name-service/switch
例如:
# getent passwd 'test_user@example' test_user@example:x:2154266625:2154266626:test_user:: # getent passwd 2154266625 test_user@example:x:2154266625:2154266626:test_user::