信頼できるドメインAD資格情報を使用してUbuntuサーバーにログインすることはできません。

信頼できるドメインAD資格情報を使用してUbuntuサーバーにログインすることはできません。

ADドメインにUbuntu 22.04サーバーが参加しています。サーバーが属するADドメインに接続されている信頼できるドメインの資格情報を使用してログインできる必要があります。信頼できるドメイン資格情報を使用してログインすることはできません。次のパッケージがインストールされます。

winbind, krb5 ユーザー, sssd-ad, サンバ

ドメインはdomain1.orgとdomain2.localです。 domain1.orgは私のサーバーが参加しているドメイン、domain2.localは信頼できるドメインです。

domain1.org資格情報を使用してログインでき、次のコマンドがすべて機能します。

ping domain1.org
ping domain2.local

id [email protected]
id [email protected]
wbinfo -i [email protected]
wbinfo -i [email protected]

wbinfo -n [email protected]
net cache flush
wbinfo --sid-to-uid <SID returned in the wbinfo -n command>

domain2.local資格情報を使用してこのUbuntuサーバーにログインすることはできません。私にはこれとほぼ同じ方法で設定されたRocky Linuxサーバーがありますが、はいdomain2.local資格情報を使用してログインできます。

Samba、sssd、nsswitch、および krb5 の構成は次のとおりです。

/etc/samba/smb.conf

[global]
workgroup = DOMAIN1
realm = DOMAIN1.ORG
netbios name = MYTEST
security = ads
server signing = mandatory
client signing = mandatory
client lanman auth = no
min protocol = SMB2
client min protocol = SMB2
client max protocol = SMB3

restrict anonymous = 2
os level = 0
preferred master = no
local master = no
domain master = no

kerberos method = secrets and keytab

load printers = no
printing = bsd
printcap name = /dev/null
disable spoolss = yes
template homedir = /home/%D/%U
template shell = /bin/bash

map acl inherit = yes
nt acl support = yes
inherit acls = Yes
acl group control = yes

log level = 10
max log size = 10
log file = /var/log/samba/samba.log

winbind use default domain = yes
idmap config * : range = 1100-65534
idmap config * : backend = tdb
idmap config * : backend = autorid
idmap config * : range = 1000000-999999999

/etc/sssd/conf.d/sssd.conf

[sssd]
config_file_version = 2
domains = DOMAIN1.ORG
reconnection_retries = 3
services = nss, pam, ssh, autofs

[domain/DOMAIN1.ORG]
#debug_level = 9
ad_hostname = mytest.domain1.org
id_provider = ad
auth_provider = ad
access_provider = ad
override_homedir = /home/%d/%u
default_shell = /bin/bash
cache_credentials = True
krb5_store_password_if_offline = True
krb5_realm = DOMAIN1.ORG
fallback_homedir = /home/%u/%d
ad_domain = domain1.org
use_fully_qualified_names = False
case_sensitive = False
ad_gpo_ignore_unreadable = True
dyndns_update = true
dyndns_refresh_interval = 43200
ad_update_samba_machine_account_password = True

[nss]
filter_users = root

[pam]
reconnection_retries = 3
offline_credentials_expiration = 2
offline_failed_login_attempts = 3
offline_failed_login_delay = 5

/etc/nsswitch.conf

passwd:         files winbind systemd sss
group:          files winbind systemd sss
shadow:         files sss
gshadow:        files

hosts:          files resolve dns
networks:       files

protocols:      db files
services:       db files sss
ethers:         db files
rpc:            db files

netgroup:       nis sss
automount:      sss

/etc/krb5.conf

[logging]
   default = FILE:/var/log/krb5.log

[libdefaults]
   default_realm = DOMAIN1.ORG
   dns_lookup_realm = true
   dns_lookup_kdc = true
   ticket_lifetime = 24h
   renew_lifetime = 7d
   forwardable = true
   udp_preference_limit = 1

すべてのコメントやヘルプに感謝します。ありがとうございます!

ベストアンサー1

まず、

apt-get purge sssd

sssdとを実行することは意味がなく、信頼する必要がありwinbindますwinbind

第二に、smb.conf間違った内容を修正してください。

winbind use default domain = yes
idmap config * : range = 1100-65534
idmap config * : backend = tdb
idmap config * : backend = autorid
idmap config * : range = 1000000-999999999

最後の2行は上記の2行よりも優先され、idmapバックエンドwinbind use default domain = yesでは使用できません。autorid上記の最初の3行を削除し、必要な信頼を提供すると正常に動作します。

おすすめ記事