我有一个带有IDMU的AD环境,并为我的域用户指定了UID/GID
。与SSSD连接的域用户在Ubuntu上与AD不共享相同的UID/GID
。
下面是Ubuntu20.10中默认的未经编辑的sssd.conf
:
% sssd --version
2.3.1
# cat /etc/sssd/sssd.conf
[sssd]
domains = webtool.space
config_file_version = 2
[domain/webtool.space]
default_shell = /bin/bash
krb5_store_password_if_offline = True
cache_credentials = True
krb5_realm = MYDOMAIN.SPACE
realmd_tags = manages-system joined-with-adcli
id_provider = ad
fallback_homedir = /home/%u@%d
ad_domain = mydomain.space
use_fully_qualified_names = True
ldap_id_mapping = True
access_provider = ad
如果用户名Auser
有UID
of 10001
和GID
of 10001
,我预计这些数字会在其他平台上持续存在,对吗?
但是SSSD似乎分配任意的UID/GID
,与AD号没有对应关系。下面是一个现实世界的例子:
% su auser@mydomain.space
Password:
auser@mydomain.space@myhostname:~/$ id
uid=397401108(auser@mydomain.space)
gid=397400512(domain admins@mydomain.space)
groups=397400512(domain admins@mydomain.space),
397400513(domain users@mydomain.space),
397400518(schema admins@mydomain.space),
397400519(enterprise admins@mydomain.space),
397400572(denied rodc password replication group@mydomain.space),
397401109(sudoers@mydomain.space),
397401112(vcsa administrators@mydomain.space),
397404603(libvirt@mydomain.space),
397407607(jumpcloud@mydomain.space)
有什么办法可以防止这种行为吗?我希望我的UID/GID
与分配给域控制器的值相对应。
更新:
多亏了星际第一答案,使映射1-1所需的就是停止SSSD服务,删除缓存,将ldap_id_mapping
从True
更改为False
。
现在,UID/GID
与AD相同:
% id
uid=10000(auser) gid=10001(administrators) groups=10001(administrators),3109(sudoers@mydomain.space),10000(domain users@mydomain.space)
为了弄清楚为什么我缺少我的用户所属的一些组.
发布于 2020-12-15 20:48:32
默认的SSD行为将把用户id和组id映射到一系列值。相反,如果在AD中定义了LDAP属性,则可以指定使用它们。
来自手册- http://manpages.ubuntu.com/manpages/bionic/en/man5/sssd-ad.5.html
By default, the AD provider will map UID and GID values from the objectSID parameter in
Active Directory. For details on this, see the “ID MAPPING” section below. If you want to
disable ID mapping and instead rely on POSIX attributes defined in Active Directory, you
should set
ldap_id_mapping = False
SSSD配置将取决于AD中使用的属性。UID和GID的缺省值是uidNumber
和gidNumber
,但是一些默认值根据运行的SSSD版本而改变。检查您正在使用的发行版的手册页。
如果更改id映射设置,则需要在测试更改之前完全清除缓存。我喜欢运行以下命令
systemctl stop sssd
rm /var/lib/sss/{db,mc}/*
sss_cache -E
# optionally clear debug logs
truncate -s 0 /var/log/sssd/*.log
systemctl start sssd
https://askubuntu.com/questions/1300389
复制相似问题