無法讓 idmap_ad 與 Ubuntu 12.04 和 Samba 4 搭配使用

無法讓 idmap_ad 與 Ubuntu 12.04 和 Samba 4 搭配使用

我正在嘗試獲取我在活動目錄中設置的 uid 和 gid 映射,以從那裡複製到我已存在的 Ubuntu 盒子,並將其添加到 Windows 2008 網域控制器。我們正在嘗試讓所有機器加入,並且由於機器已經具有來自 OpenLDAP 的這些映射,因此讓它們複製非常重要。我正在使用 Samba4、Winbind、Ubuntu 12.04。

smb.conf:

[global]
security = ads
realm = DOMAIN.NET
password server = dc01.domain.net
workgroup = DOMAIN
#idmap uid = 1000-99999
#idmap gid = 1000-99999
idmap config *:backend = tdb
idmap config *:range = 70001-80000
idmap config DOMAIN:backend = ad
idmap config DOMAIN:range = 500-40000
winbind nss info = rfc2307
winbind separator = +
winbind enum users = no
winbind enum groups = no
winbind use default domain = yes
template homedir = /home/%U
template shell = /bin/bash
client use spnego = yes
domain master = no

krb5.conf:

[logging]
    default = FILE:/var/log/krb5.log
[libdefaults]
    allow_weak_crypto = true
    ticket_lifetime = 24000
    default_realm = DOMAIN.NET
    default_tkt_enctypes = rc4-hmac
    default_tgs_enctypes = rc4-hmac
[realms]
    DOMAIN.NET = {
        kdc = DC01.DOMAIN.NET
        admin_server = DC01.DOMAIN.NET
        default_domain = DOMAIN
}
[domain_realm]
    .domain.net = DOMAIN.NET
    domain.net = DOMAIN.NET

nsswitch.conf

# pre_auth-client-config # passwd:         compat
passwd: compat winbind
# pre_auth-client-config # group:          compat
group: compat winbind
# pre_auth-client-config # shadow:         compat
shadow: compat winbind

hosts:          files dns wins
networks:       files

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

# pre_auth-client-config # netgroup:       nis
netgroup: nis

當我新增 idmap config DOMAIN:backend = ad 行時,我無法使用網域帳戶 ssh 進入計算機,只能使用本機帳戶。如果我註解掉這些行,我就可以使用網域帳戶進行 SSH 並讀取群組。兩個配置都允許我從 wbinfo 獲取返回,兩個 getent 也只返回本地帳戶。我簡直難住了。

答案1

必須在網域使用者群組上設定 Unix 屬性才能拉入 AD 使用者。

相關內容