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 / 问题 / 738802
Accepted
aseq
aseq
Asked: 2015-11-25 19:34:20 +0800 CST2015-11-25 19:34:20 +0800 CST 2015-11-25 19:34:20 +0800 CST

无法使用 samba 工具 net 或 realm/sssd 加入域

  • 772

在 rhel7 服务器上,我试图将服务器加入域,但出现以下故障:

net ads join -S domain.example.org -U name
Enter name's password:
Failed to join domain: failed to set machine kerberos encryption types: Insufficient access

pam、krb5、samba、dns 以及远程活动目录服务器中的对象的相关设置配置正确,这意味着系统将使用 rhel6 和 ubuntu 14.04 成功绑定。

关于我遇到的具体错误,我无法找到太多信息。我试图在 krb5.conf 中设置allow_weak_crypto=true只是为了看看它是否与此有关,但它没有效果。

我遵循了https://technet.microsoft.com/en-us/library/bb463167.aspx中的一些故障排除提示,但没有运气,我尝试过的东西似乎工作正常。

具体来说,我能够执行以下操作,这意味着我可以获得用户名的初始凭据:

kinit name
Password for [email protected]: 

我还可以使用ktutil生成一个 keytab 文件,当我将它移动到 /etc/krb5.keytab klist -e时,它​​会显示正确的内容。但网络广告加入不断失败。

编辑:检查 rhel7 samba 源包后,我在README.dc中发现以下内容:

一旦 Samba AD DC 对 MIT Kerberos KDC 的支持准备就绪,我们就会提供 Samba AD DC 功能。

我怀疑这可能是问题所在,我必须等到它准备好。

Edit2:使用领域和 sssd 似乎有同样的问题。做完之后:

realm -v join --user=example ad.example.org

我发现以下错误:

* LANG=C /usr/sbin/adcli join --verbose --domain ad.example.org --domain-realm AD.EXAMPLE.ORG --domain-controller 192.0.2.11 --login-type user --login-user example --stdin-password
! Insufficient permissions to set encryption types on computer account: CN=example,OU=w,OU=x,DC=ad,DC=example,DC=org: 00002098: SecErr: DSID-03150BB9, problem 4003 (INSUFF_ACCESS_RIGHTS), data 0

请注意,这适用于 rhel6。我也无权更改 AD 服务器或我在那里的帐户。

rhel版本为7.2,相关包在以下版本:

Name        : realmd
Version     : 0.16.1
--
Name        : adcli
Version     : 0.7.5
--
Name        : krb5-workstation
Version     : 1.13.2
--
Name        : samba-common
Version     : 4.2.3

journalctl -e SYSLOG_IDENTIFIER=realmd的净化输出:

Jan 21 14:56:20 host.example.org realmd[25796]:  * Using domain name: example.org
Jan 21 14:56:20 host.example.org realmd[25796]:  * Using computer account name: HOST
Jan 21 14:56:20 host.example.org realmd[25796]:  * Using domain realm: example.org
Jan 21 14:56:20 host.example.org realmd[25796]:  * Calculated computer account name from fqdn: HOST
Jan 21 14:56:20 host.example.org realmd[25796]:  * Generated 120 character computer password
Jan 21 14:56:20 host.example.org realmd[25796]:  * Using keytab: FILE:/etc/krb5.keytab
Jan 21 14:56:20 host.example.org realmd[25796]:  * Using fully qualified name: host.example.org
Jan 21 14:56:20 host.example.org realmd[25796]:  * Using domain name: example.org
Jan 21 14:56:20 host.example.org realmd[25796]:  * Using computer account name: HOST
Jan 21 14:56:20 host.example.org realmd[25796]:  * Using domain realm: example.org
Jan 21 14:56:20 host.example.org realmd[25796]:  * Looked up short domain name: AD
Jan 21 14:56:20 host.example.org realmd[25796]:  * Found computer account for HOST$ at: CN=host,OU=w,OU=x,DC=ad,DC=example,DC=org
Jan 21 14:56:20 host.example.org realmd[25796]:  * Set computer password
Jan 21 14:56:20 host.example.org realmd[25796]:  * Retrieved kvno '87' for computer account in directory: CN=host,OU=w,OU=x,DC=ad,DC=example,DC=org
Jan 21 14:56:20 host.example.org realmd[25796]:  ! Insufficient permissions to set encryption types on computer account: CN=host,OU=w,OU=x,DC=ad,DC=example,DC=org: 00002098: SecErr: DSID-03150BB9, problem 4003 (INSUFF_ACCESS_RIGHTS),  
Jan 21 14:56:20 host.example.org realmd[25796]:  * Modifying computer account: userAccountControl
Jan 21 14:56:20 host.example.org realmd[25796]:  * Modifying computer account: operatingSystem, operatingSystemVersion, operatingSystemServicePack
Jan 21 14:56:20 host.example.org realmd[25796]:  ! Couldn't set operatingSystem, operatingSystemVersion, operatingSystemServicePack on computer account: CN=host,OU=w,OU=x,DC=ad,DC=example,DC=org: Insufficient access
Jan 21 14:56:20 host.example.org realmd[25796]:  * Updated existing computer account: CN=host,OU=w,OU=x,DC=ad,DC=example,DC=org
Jan 21 14:56:20 host.example.org realmd[25796]:  * Discovered which keytab salt to use
Jan 21 14:56:20 host.example.org realmd[25796]:  * Added the entries to the keytab: [email protected]: FILE:/etc/krb5.keytab
Jan 21 14:56:20 host.example.org realmd[25796]:  * Added the entries to the keytab: HOST/[email protected]: FILE:/etc/krb5.keytab
Jan 21 14:56:20 host.example.org realmd[25796]:  * Added the entries to the keytab: HOST/[email protected]: FILE:/etc/krb5.keytab
Jan 21 14:56:21 host.example.org realmd[25796]:  * Added the entries to the keytab: RestrictedKrbHost/[email protected]: FILE:/etc/krb5.keytab
Jan 21 14:56:21 host.example.org realmd[25796]:  * Added the entries to the keytab: RestrictedKrbHost/[email protected]: FILE:/etc/krb5.keytab
Jan 21 14:56:21 host.example.org realmd[25796]: process exited: 25879
Jan 21 14:56:21 host.example.org realmd[25796]:  * /usr/bin/systemctl enable sssd.service
Jan 21 14:56:21 host.example.org realmd[25796]: process started: 25880
Jan 21 14:56:21 host.example.org realmd[25796]: Created symlink from /etc/systemd/system/multi-user.target.wants/sssd.service to /usr/lib/systemd/system/sssd.service.
Jan 21 14:56:21 host.example.org realmd[25796]: process exited: 25880
Jan 21 14:56:21 host.example.org realmd[25796]:  * /usr/bin/systemctl restart sssd.service
Jan 21 14:56:21 host.example.org realmd[25796]: process started: 25894
Jan 21 14:56:22 host.example.org realmd[25796]: process exited: 25894
Jan 21 14:56:22 host.example.org realmd[25796]:  * /usr/bin/sh -c /usr/sbin/authconfig --update --enablesssd --enablesssdauth --enablemkhomedir --nostart && /usr/bin/systemctl enable oddjobd.service && /usr/bin/systemctl start oddjobd.se
Jan 21 14:56:22 host.example.org realmd[25796]: process started: 25901
Jan 21 14:56:23 host.example.org realmd[25796]: process exited: 25901
Jan 21 14:56:23 host.example.org realmd[25796]:  * Successfully enrolled machine in realm
Jan 21 14:56:23 host.example.org realmd[25796]: released daemon: current-invocation
Jan 21 14:56:23 host.example.org realmd[25796]: client gone away: :1.3100
Jan 21 14:56:23 host.example.org realmd[25796]: released daemon: :1.3100
Jan 21 14:57:23 host.example.org realmd[25796]: quitting realmd service after timeout
Jan 21 14:57:23 host.example.org realmd[25796]: stopping service

净广告的净化输出-P 状态:

objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: user
objectClass: computer
cn: host
distinguishedName: CN=host,OU=w,OU=x,DC=ad,DC=example,DC=org
instanceType: 4
whenCreated: 2012
whenChanged: 2016
uSNCreated: 1687590
memberOf: CN=group,OU=groups,OU=w,DC=ad,DC=example,DC=org
uSNChanged: 1212121212
name: host
objectGUID: x
userAccountControl: 6
badPwdCount: 0
codePage: 0
countryCode: 0
badPasswordTime: 1
lastLogoff: 0
lastLogon: 1
localPolicyFlags: 0
pwdLastSet: 1
primaryGroupID: 600
objectSid: S-1-5-21
accountExpires: 9
logonCount: 1
sAMAccountName: HOST$
sAMAccountType: 8
dNSHostName: host.ad.example.org
servicePrincipalName: RestrictedKrbHost/HOST
servicePrincipalName: RestrictedKrbHost/host.ad.example.org
servicePrincipalName: HOST/host.ad.example.org
servicePrincipalName: HOST/HOST
objectCategory: CN=Computer,CN=Schema,CN=Configuration,DC=ad,DC=example,DC=org
isCriticalSystemObject: FALSE
dSCorePropagationData: 2
dSCorePropagationData: 3
dSCorePropagationData: 4
dSCorePropagationData: 5
dSCorePropagationData: 6
lastLogonTimestamp: 1
active-directory
  • 3 3 个回答
  • 26592 Views

3 个回答

  • Voted
  1. Thomas Schneider
    2015-11-26T09:21:47+08:002015-11-26T09:21:47+08:00

    你为什么用网络?您应该使用 samba-tool 加入域

    samba-tool domain join domain.example.org DC -Uadministrator --realm=domain.example.org
    

    net 在 samba 4 中不再真正使用,除了共享和其他一些东西。
    不要乱用 kerberos 加密设置。

    • 3
  2. doombird
    2016-01-14T16:41:32+08:002016-01-14T16:41:32+08:00

    我有同样的问题,realm加上adcli是解决方案。 realm默认使用 samba-common 后端。获取 realmd 和 adcli 包,然后使用

    # realm join --membership-software=adcli -U <username> <domain>
    

    您甚至不必adcli直接使用。请注意,会发生相同的权限错误,但您继续加入域,而不是在加密类型拒绝时失败。

    这让我被捆绑了好几个星期。该项目最终被推迟,直到我弄明白为止。从我的痛苦中学习。

    不幸的是,据我所知adcli,似乎没有任何方法可以在不更改 AD 的情况下验证加入。要验证,您可以备份 /etc/samba/smb.conf 并将其替换为(只是):

    realm = <REALM>
    workgroup = <WORKGROUP>
    

    然后运行net ads -P status以获取从 AD 中提取的有关您新注册的机器帐户的大量信息。您可以ldapsearch通过使用 Windows 工具搜索或询问您的 AD 管理员对 DC 执行相同操作,但我不知道哪些选项可用于 LDAP,我喜欢自给自足。

    通常 adcli/net 会注册一台机器,但 sssd_ad 不能很好地用于开箱即用的身份管理。我发现特别是在 RIDS 超过 200000 或已从旧版本更新多次的企业 AD 环境中,通常会出现问题。如果您从net ads status命令中获得结果但仍无法获取用户信息,请查找 sssd 和 sssd_ad 的问题。 systemctl status sssd.service是一个很好的起点。但是,针对 Id 映射和身份验证的 sssd_ad 故障排除不在您原始问题的范围内。

    额外的信用阅读:

    freedesktop.org 上的领域文档。

    freedesktop.org 上的 adcli 文档。

    sssd_ad 的手册页

    • 3
  3. Best Answer
    aseq
    2016-05-20T18:40:55+08:002016-05-20T18:40:55+08:00

    在 samba 从 4.1 升级到 4.3 次要版本后,debian 和 ubuntu 上似乎也出现了该问题。这意味着它不是特定于 redhat 的。顺便说一句,我确实联系了 redhat 支持。

    我无法找到解决方案,但我找到了一个足够好的解决方法。由于某种原因,当发生特定故障时,未创建密钥表或创建了不正确的密钥表。绑定到活动目录服务器实际上是成功的,为了使事情正常工作,需要创建一个新的密钥表。

    加入域失败:设置机器kerberos加密类型失败:访问权限不足

    运行此命令以创建密钥表:

    net -P ads keytab create
    

    尽管我选择继续使用 samba,但我认为在使用领域时您也可以使用此工作。

    • 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