AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 832217
Accepted
Sethos II
Sethos II
Asked: 2017-02-14 01:41:11 +0800 CST2017-02-14 01:41:11 +0800 CST 2017-02-14 01:41:11 +0800 CST

与 SSSD 和 SMB 的 ID 映射

  • 772

我正在尝试让 samba 共享在 Windows (SID) 和 Linux (uid/gid) 客户端上使用正确的 ID。问题是 uid 和 gid 没有正确映射回 SID 并且 SID 没有解析为名称。什么可能导致这个问题,如何解决?

什么有效

  • 从 Active Directory UNIX 属性映射到 Linux 上的 uid/gid
  • 访问共享
    • Windows:资源管理器中的 UNC-Path,接受 Kerberos 票证(凭证没有问题)
    • Linux:sudo mount -t cifs //ribonas2/test /mnt/ribonas2/smb/ -o domain=DOMAIN,username=paul.jaehne
  • 处理共享上的文件

什么不起作用

  • 在 Windows 上创建的文件具有Unix User\和Unix Group\(在打开安全选项卡时,UNIX uid 和 gid 也会在很短的时间内可见)而不是DOMAIN\作为用户和组的前缀
  • 添加权限是有缺陷的:我可以从域中添加主体,然后很快就会DOMAIN\whatever正确显示。当我等待一段时间或从另一台计算机查看共享时,仅显示 SID(SID 正确,但未解析为名称):

看图片

环境/配置

  • 我使用了以下指南(由于信誉要求,无法添加真实链接):
    • Ubuntu 16.04 SAMBA 文件服务器指南
    • Ubuntu 16.04 SSSD AD 指南
    • SAMBA 维基域成员
    • SAMBA 维基 ACL
  • 多个域控制器(Windows Server 2003 和 Windows Server 2012 R2)
  • Windows Server 2003 中的 Active Directory 架构
  • Ubuntu 服务器 16.04
    • SSSD 1.13.4-1ubuntu1.1
    • SMB 2:4.3.8+dfsg-0ubuntu1
    • 加入了两者realm join和net ads join

sssd.conf:

[sssd]
domains = domain.company.com
config_file_version = 2
services = nss, pam

[domain/domain.company.com]
realmd_tags = manages-system joined-with-adcli
ad_domain = domain.company.com
krb5_realm = DOMAIN.COMPANY.COM

id_provider = ad
cache_credentials = True
krb5_store_password_if_offline = True
enumerate = True
use_fully_qualified_names = False

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

# use uid and gid from active directory
ldap_id_mapping = False

# needed to use correct active directory properties (Windows Server 2003)
ldap_schema = ad
ldap_user_object_class = person
ldap_user_name = msSFU30Name
ldap_user_uid_number = msSFU30UidNumber
ldap_user_gid_number = msSFU30GidNumber
ldap_user_home_directory = msSFU30HomeDirectory
ldap_user_shell = msSFU30LoginShell
ldap_user_gecos = displayName
ldap_group_object_class = group
ldap_group_name = msSFU30Name
ldap_group_gid_number = msSFU30GidNumber

smb.conf(标准配置文件中的设置是缩进的):

[global]
server role = member server
workgroup = DOMAIN
realm = DOMAIN.COMPANY.COM
security = ads
password server = dc1.domain.company.com # shouldn't be necessary and same problem without this line
idmap config * : backend = tdb
idmap config * : range = 100000-999999
idmap config DOMAIN : backend = ad
idmap config DOMAIN : range = 10000-20000 # the UNIX attributes are manually assigned in this range
kerberos method = secrets and keytab

    server string = %h server (Samba, Ubuntu)

    dns proxy = no

    log file = /var/log/samba/log.%m
log level = 10
    max log size = 1000
    syslog = 0

    panic action = /usr/share/samba/panic-action %d

    passdb backend = tdbsam
    obey pam restrictions = yes
    unix password sync = yes
    passwd program = /usr/bin/passwd %u
    passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
    pam password change = yes

    map to guest = bad user

    usershare allow guests = yes

# needed for Windows ACL/ACE
vfs objects = acl_xattr
map acl inherit = yes
store dos attributes = yes

[test]
    path = /srv/samba/test
    writable = yes

TL;DR:为什么 UNIX 属性不解析为 SID,为什么 SID 不解析为名称?

active-directory server-message-block ubuntu-16.04 sssd mapping
  • 3 3 个回答
  • 18232 Views

3 个回答

  • Voted
  1. Best Answer
    Archer
    2017-03-01T21:10:42+08:002017-03-01T21:10:42+08:00

    我也有同样的情况。我通过安装 samba-winbind 修复了它。我认为根本原因是 samba 不知道如何正确查找名称。当您安装 winbind 时,smbd 将使用 winbind 进行名称解析。否则,它只使用 linux UID、GID,这就是为什么您在 Windows 中看到 Unix User/Unix Group。

    我无法解释更多,但希望这对你有所帮助。

    • 2
  2. William Gruesbeck Jr
    2018-12-05T13:48:24+08:002018-12-05T13:48:24+08:00

    答案是使用 Samba 和 SSSD 中使用的 id-mapping 后端。Samba 的 winbind“摆脱”和“自动摆脱”不会像 SSSD 那样将 Windows SID 映射到 uid/gid 号。因此,如果您的 CIFS 服务器使用 Samba/winbind 加入域,并且您的客户端使用默认选项通过 SSSD 连接,则 id 映射将失败。

    SSSD 有一个设置ldap_idmap_autorid_compat,您可以True在 sssd.conf 文件中设置该设置(应该):“更改 ID 映射算法的行为,使其行为更类似于 winbind 的“idmap_autorid”算法。 ”因此允许您的 SSSD 客户端解析这个问题。

    • 2
  3. bukowski
    2018-12-22T03:49:14+08:002018-12-22T03:49:14+08:00

    我use_fully_qualified_names = True在 sssd.conf 中使用它没有任何 winbind 包。

    • 1

相关问题

  • 如果以域用户身份远程登录,PC 速度极慢

  • 如何在 Windows 2003 的 ou 级别应用策略

  • 允许用户更改其 Active Directory 密码的 Web 界面

  • MOSS 2007 无法使用 ActiveDirectoryMembershipProvider 配置表单身份验证

  • 通过 VPN 更改 Active Directory 密码

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve