使用 samba4 活动目录配置 nsscache

使用 samba4 活动目录配置 nsscache

我在使用 nsscache 缓存 samba4 AD 中的用户时遇到问题,因为 AD 中没有uid,而是samAccountNamecn。当我使用 uid-like 属性时:

# Default uid-like attribute
ldap_uidattr = 'sAMAccountName'

我收到以下错误:

# nsscache  update --full
WARNING:root:invalid object passed: 'uid' not in {'modifyTimeStamp': ['20190915102717.0Z'], 'sAMAccountName': ['user'], 'cn': ['user']}
Traceback (most recent call last):
  File "/usr/sbin/nsscache", line 33, in <module>
    return_value = nsscache_app.Run(sys.argv[1:], os.environ)
  File "/usr/lib/python2.7/dist-packages/nss_cache/app.py", line 240, in Run
    retval = command_callable().Run(conf=conf, args=args)
  File "/usr/lib/python2.7/dist-packages/nss_cache/command.py", line 230, in Run
    force_lock=options.force_lock)
  File "/usr/lib/python2.7/dist-packages/nss_cache/command.py", line 303, in UpdateMaps
    force_write=force_write)
  File "/usr/lib/python2.7/dist-packages/nss_cache/update/updater.py", line 275, in UpdateFromSource
    force_write, location=None)
  File "/usr/lib/python2.7/dist-packages/nss_cache/update/map_updater.py", line 75, in UpdateCacheFromSource
    location=location)
  File "/usr/lib/python2.7/dist-packages/nss_cache/sources/source.py", line 63, in GetMap
    return self.GetPasswdMap(since)
  File "/usr/lib/python2.7/dist-packages/nss_cache/sources/ldapsource.py", line 371, in GetPasswdMap
    since=since)
  File "/usr/lib/python2.7/dist-packages/nss_cache/sources/ldapsource.py", line 589, in GetUpdates
    raise ValueError('Invalid object passed: %r', obj)
ValueError: ('Invalid object passed: %r', {'modifyTimeStamp': ['20190915102717.0Z'], 'sAMAccountName': ['user'], 'cn': ['user']})

是否可以使用活动目录配置 nsscache ?

谢谢

答案1

似乎无法使用 Active Directory 配置 nsscache。查看源代码后,这里是我得到的例外这里是作为对象属性所需的基本字段。

都不uid是samba4 活动目录中对象的一部分uidNumbergitNumber

uid可以添加该属性,但是根据架构,不允许添加uidNumber或添加。gidNumber

相关内容