使用 SSSD 将 Ubuntu 22.04 加入 Active Directory 后找不到域

使用 SSSD 将 Ubuntu 22.04 加入 Active Directory 后找不到域

从 Ubuntu 20.04 开始,我们使用 SSSD 和 Realmd 将这些服务器加入到我们的 Active Directory 域之一。这(几乎)开箱即用。

然而,对于 Ubuntu 22.04,我们遇到了问题。我没有可能的解决方案,因此我的问题。

我们的组织有 1 个 AD 森林。在这个森林中,我们有一个名为“示例.local“。该域有几个子域,”产品示例.local“,”用户.example.local“,”acc.示例.local”。”用户.example.local“有一个名为”的子域dev.users.example.local”。该域有一个快捷方式信任“产品示例.local“(重要的是要记住)。

当服务器加入域时“dev.users.example.local”,用户(来自林中的任何域)应该能够登录到服务器。

这在 Ubuntu 20.04 上按预期工作(使用 SSSD 版本 2.2.3)。在 Ubuntu 22.04 上,只有来自加入的域 (dev.users.example.local) 和来自具有快捷方式信任的域的用户才能被发现并能够登录到服务器。

我们尝试使用 sssctl 来调试这个问题。

跑步sssctl domain-list

返回结果

  • dev.users.example.local
  • 产品示例.local

预期结果:

  • dev.users.example.local
  • 用户.example.local
  • 示例.local
  • 产品示例.local
  • acc.示例.local

SSSD版本:

  • Ubuntu 22.04:2.6.3
  • Ubuntu 20.04:2.2.3

这是我们的 SSSD 配置(在 Ubuntu 20.04 上按预期工作):

[sssd]
domains = dev.users.example.local
config_file_version = 2
services = nss, pam

debug_level = 9

[domain/dev.users.example.local]
# Offline logins
# cache_credentials = true

# Providers
id_provider = ad
auth_provider = ad
access_provider = simple

# Uncomment if you want to use POSIX UIDs and GIDs set on the AD side
# ldap_id_mapping = False

# Uncomment if the trusted domains are not reachable
# ad_enabled_domains = ad.example.com

# Set default shell and override AD Home directory
default_shell = /bin/bash
override_homedir = /home/%d/%u

# Comment out if you prefer to use shortnames.
use_fully_qualified_names = True

# AD Specific settings
# ad_use_ldaps = True

debug_level = 9

[nss]
debug_level = 9

[pam]
debug_level = 9

PAM 配置:/etc/pam.d/sshd

# PAM configuration for the Secure Shell service

# Standard Un*x authentication.
@include common-auth

# Disallow non-root logins when /etc/nologin exists.
account    required     pam_nologin.so

# Uncomment and edit /etc/security/access.conf if you need to set complex
# access limits that are hard to express in sshd_config.
# account  required     pam_access.so

# Standard Un*x authorization.
@include common-account

# SELinux needs to be the first session rule.  This ensures that any
# lingering context has been cleared.  Without this it is possible that a
# module could execute code in the wrong domain.
session [success=ok ignore=ignore module_unknown=ignore default=bad]        pam_selinux.so close

# Set the loginuid process attribute.
session    required     pam_loginuid.so

# Create a new session keyring.
session    optional     pam_keyinit.so force revoke

# Standard Un*x session setup and teardown.
@include common-session

# Print the message of the day upon successful login.
# This includes a dynamically generated part from /run/motd.dynamic
# and a static (admin-editable) part from /etc/motd.
session    optional     pam_motd.so  motd=/run/motd.dynamic
session    optional     pam_motd.so noupdate

# add to the end (create Home Dir automatically when initial login)
session optional        pam_mkhomedir.so skel=/etc/skel umask=077

# Print the status of the user's mailbox upon successful login.
session    optional     pam_mail.so standard noenv # [1]

# Set up user limits from /etc/security/limits.conf.
session    required     pam_limits.so

# Read environment variables from /etc/environment and
# /etc/security/pam_env.conf.
session    required     pam_env.so # [1]
# In Debian 4.0 (etch), locale-related environment variables were moved to
# /etc/default/locale, so read that as well.
session    required     pam_env.so user_readenv=1 envfile=/etc/default/locale

# SELinux needs to intervene at login time to ensure that the process starts
# in the proper default security context.  Only sessions which are intended
# to run in the user's context should be run after this.
session [success=ok ignore=ignore module_unknown=ignore default=bad]        pam_selinux.so open

# Standard Un*x password updating.
@include common-password

使用realmd,我们允许某些AD 组登录到服务器。

我尝试在 Ubuntu 22.04 上安装新版(和旧版 2.2.3)SSSD,但无法执行此操作。

我们怎样才能在不更改 Active Directory 的情况下完成这项工作?我们这个配置做错了什么?

相关内容