跨域 - AD 组成员身份更改未反映在 winbind 中

跨域 - AD 组成员身份更改未反映在 winbind 中

我在这个帖子上也有类似的案例AD 组成员身份更改未反映在 winbind 信息中。唯一的区别是,在我的场景中,这仅发生在“跨域”上。

这是我的配置 -http://pastebin.ca/3035431...

如果有人能给我一些启发,我将不胜感激:

(1)如何让“id”命令反映正确的组成员身份。

(2) 一旦 Active Directory 中发生更改,如何让 Winbind 自动反映组成员身份。

谢谢!

答案1

在尝试我的建议之前,请了解它可能会重置 Samba 创建的 UID/GID 映射。我这样做是因为我关心的所有内容都来自 Active Directory rfc2307,因此我可以轻松地擦除 Samba / Winbindd 缓存并重新开始。

对我而言最终有用的是从 /var/cache/samba 中删除所有文件。

最近,我为一个顽固的用户 ID 而苦恼,无法更新群组列表。当然是我的用户 ID。

我不认为我处于跨域情况,但这是可能的。我处于一个大型多域 Active Directory 中,但只在一个域中与用户和组一起工作。

我尝试了很多尝试,包括“net cache flush”、向 winbindd 添加 --no-caching 以及从 /var/lib/samba 中删除 group_mapping.tdb、winbindd_idmap.tdb 和 winbindd_cache.tdb。

这是一个包含清除 Samba / Winbindd 缓存文件的命令的脚本:

#!/usr/bin/bash

#
# Quicky for backing up and removing the
# Samba / Winbindd cache files
#
# This solution worked when a single users group
# list would not update when changed in Active
# directory.
#
#
# Environment
#
# CentOS 7 with all updates as of 20150828
# Sernet Samba 4.2.3 - Version 4.2.3-SerNet-RedHat-18.el7
#

/usr/bin/sh /etc/init.d/sernet-samba-smbd stop
/usr/bin/sh /etc/init.d/sernet-samba-winbindd stop
/usr/bin/sh /etc/init.d/sernet-samba-nmbd stop

cd /var

/usr/bin/tar cbzf 512 samba_var_backup_`date '+%Y%m%d_%H%M%S'`.tgz cache/samba lib/samba log/samba

/usr/bin/find cache/samba -type f -exec /usr/bin/rm -f {} \;

/usr/bin/rm -f lib/samba/group_mapping.tdb
/usr/bin/rm -f lib/samba/winbindd_idmap.tdb
/usr/bin/rm -f lib/samba/winbindd_cache.tdb

/usr/bin/sh /etc/init.d/sernet-samba-nmbd start
/usr/bin/sh /etc/init.d/sernet-samba-winbindd start
/usr/bin/sh /etc/init.d/sernet-samba-smbd start

我认为是我造成了导致我的用户 ID 无法更新的情况。在此 CentOS 7 系统上,我开始尝试使用 CentOS 7 内置的 sssd 和 Samba(我认为是 Samba 4.1.x)与 Active Directory 通信的“realm”命令和 SSSD 方法。

SSSD 几乎可以正常工作,但速度太慢了。“id”和“groups”等命令的速度非常慢。我认为 Samba 之所以遇到困难,是因为查找速度太慢了。

由于新的 winbindd 和默认的更大 io,我决定尝试最新的 Samba 4.2.x。

Sernet Samba / Winbindd 4.2.3 似乎运行良好。Samba 毫无问题地加入了 Active Directory。命令行“id”和“groups”非常快,尤其是在第一次查找之后。

这是我的 smb.conf,供参考:

[global]
workgroup = PROJECTS
security = ads
realm = PROJECTS.EXAMPLE.NET
kerberos method = secrets and keytab

max log size = 50000
log level = 2

template homedir = /home/%U
template shell = /bin/bash

idmap config PROJECTS : default = yes
idmap config PROJECTS : backend = ad
idmap config PROJECTS : schema_mode = rfc2307
idmap config PROJECTS : range = 10000-9999999999
idmap config *:backend = tdb
idmap config *:range = 2000-3999

winbind nss info = rfc2307
winbind use default domain = yes
winbind offline logon = no
winbind enum groups = yes
winbind enum users = yes
winbind refresh tickets = yes

#
# 20150827 by Joe
# Comment out expand groups for now
# I added it trying to solve nested groups not working
# correctly. Look ups slowed down when I added this and
# did not solve the problem for my login.
#
## winbind expand groups = 3

os level = 0
local master = no
domain master = no
preferred master = no


# ------------------ Options Joe Likes ------------------------
#

path = /tmp
force create mode = 0775
force directory mode = 2775
unix extensions = no
wide links = yes
load printers = no
map archive = no
map readonly = permissions
nt acl support = no


#============================ Share Definitions ==============================

[projects]
        path = /disks/projects/projects_share
        comment =  Projects Storage

        writeable = Yes
        browseable = yes
        guest ok = no

答案2

这似乎会删除缓存并强制 winbind 从 ADC 中提取信息:

service winbind stop
rm /var/cache/samba/netsamlogon_cache.tdb
service winbind start

相关内容