使用 sssd 針對 /etc/passwd 進行本地身份驗證和識別?

使用 sssd 針對 /etc/passwd 進行本地身份驗證和識別?

這個問題是關於 RedHat Enterprise Linux 7/8/9 和 Ubuntu 22.04 的,但它對於大多數發行版來說可能相當普遍。

我讓 sssd 使用兩個網域對 Active Directory 和基於 openldap 的 LDAP 伺服器進行驗證。

用戶可以成功登入[電子郵件受保護]並針對 Active Directory 進行驗證,或以下列身分登入[電子郵件受保護]並針對 openldap 進行身份驗證。在這兩種情況下,身分資訊(UID、Gecos 和主目錄)均來自 openldap 伺服器。所有相關用戶都存在於兩個系統中(長話短說為什麼要這樣設置,這裡並不真正相關)。

無論使用者使用兩個網域中的哪一個,Linux 都會將該登入視為相同使用者。

我剛剛收到一個新要求,需要添加一個新的 SSSD 域(名為“local”),該域根據本地 /etc/{password,shadow} 進行身份驗證,並且無需任何網路流量即可獲取身份資訊。 /etc/password 和 /etc/shadow 將會被正確填滿(超出了這個問題的範圍)。

有沒有辦法建立一個使用本機檔案作為身份驗證和識別來源的 sssd 網域?

這可能不相關,但這是兩個現有的 SSSD 域。

活動目錄:

[domain/ad.mydomain.com]
auth_provider = krb5
id_provider = ldap
# We do not allow changing passwords
# chpass_provider = none

krb5_server = <redacted>
krb5_realm = AD.MYDOMAIN.COM

# Regardless of the auth provider, the id information always comes from
# LDAP.
ldap_schema = rfc2307
ldap_uri = ldaps://<redacted>/
ldap_search_base = ou=people,dc=mydomain,dc=com
ldap_group_member = memberuid
ldap_tls_reqcert = demand
ldap_tls_cacert = /etc/openldap/cacerts/<redacted>

ldap_default_bind_dn = <redacted>
ldap_default_authtok_type = password
ldap_default_authtok = <redacted>
ldap_user_ssh_public_key = sshPublicKey

entry_cache_timeout = 600
ldap_network_timeout = 3
cache_credentials = True

override_homedir = /home/%u
fallback_homedir = /home/%u
default_shell = /bin/bash

# Some performance tweaks. Without it, LDAP is painfully slow!
enumerate = false
ignore_group_members = true

開啟LDAP:

[domain/mydomain.com]
auth_provider = ldap
id_provider = ldap
# We do not allow changing passwords outside of USD_ONE
# chpass_provider = none

# Regardless of the auth provider, the id information always comes from
# LDAP.
ldap_schema = rfc2307
... Remainder is same as for Active Directory

我想做的是類似的事情(這實際上不起作用):

[domain/local]
auth_provider = files
id_provider = files # don't use LDAP for this domain
... other parameters

有沒有辦法讓SSSD使用本地檔案?

相關內容