我使用 LDAP 将我的 solaris 服务器添加到 Active Directory,我正在尝试使用 AD 自动挂载。
我创建了一个 powershell 脚本来创建用于自动安装的 NisObjects:
Import-Module ActiveDirectory
$basedn="ou=TEST,dc=test,dc=internal"
New-ADOrganizationalUnit -Name "autofs" -Path $basedn
New-ADObject -Name auto.master -Path "OU=autofs,$basedn" -Type nisMap -OtherAttributes @{'nisMapName'='auto.master'}
New-ADObject -Name /home -Path "CN=auto.master,OU=autofs,$basedn" -Type nisObject -OtherAttributes @{'nisMapName'='auto.master' ; 'nisMapEntry'='auto.home'}
New-ADObject -Name auto.home -Path "OU=autofs,$basedn" -Type nisMap -OtherAttributes @{'nisMapName'='auto.home'}
New-ADObject -Name test -Path "CN=auto.home,OU=autofs,$basedn" -Type nisObject -OtherAttributes @{'nisMapName'='auto.home'; 'nisMapEntry'='/root/test'}
下面是我在 ldapclient 上使用的
ldapclient mod \
-a "serviceSearchDescriptor=auto_home:cn=auto.home,ou=autofs,ou=TEST,dc=test,dc=internal" \
-a objectclassMap=automount:automountMap=nisMap \
-a objectclassMap=automount:automount=nisObject \
-a objectclassMap=auto_home:automount=nisObject \
-a attributeMap=automount:automountMapName=nisMapName \
-a attributeMap=automount:automountKey=cn \
-a attributeMap=automount:automountInformation=nisMapEntry \
-a attributeMap=auto_home:automountMapName=nisMapName \
-a attributeMap=auto_home:automountKey=cn \
-a attributeMap=auto_home:automountInformation=nisMapEntry
做 ldaplist 时ldaplist -l auto_home "*"
我得到以下信息:
dn: automountKey=test,automountKey=auto.home,OU=autofs,OU=TEST,DC=test,DC=internal
objectClass: top
objectClass: automount
automountKey: test
distinguishedName: CN=test,CN=auto.home,OU=autofs,OU=TEST,DC=test,DC=internal
instanceType: 4
whenCreated: 20170714154438.0Z
whenChanged: 20170714160835.0Z
uSNCreated: 20750
uSNChanged: 20826
showInAdvancedViewOnly: TRUE
name: test
objectGUID:: AqPK14JbKkuwP3bR0ahsVw==
objectCategory: CN=NisObject,CN=Schema,CN=Configuration,DC=test,DC=internal
dSCorePropagationData: 16010101000000.0Z
automountMapName: auto_home
automountInformation: /root/test
这看起来是正确的,但是当我进入 /home/test 目录时,我在日志中得到了这个:
Jul 14 16:09:25 SOL11-CLIENT automountd[4647]: [ID 734814 daemon.error] mapline_to_mapent: bad location= map=auto_home key=test
Jul 14 16:09:25 SOL11-CLIENT automountd[4647]: [ID 406441 daemon.error] parse_entry: mapentry parse error: map=auto_home key=test
有任何想法吗?