无法加入Active Directory域


9

我试图通过遵循Ubuntu SSSD和Active Directory指南,将Ubuntu 16.04服务器加入Windows 2003 R2域。我的管理员说,从控制器方面来说,它是域的一部分。但是SSSD似乎无法启动并net ads join失败。

krb5.conf由安装程序修改,现在有这个:

kyle@Server21:~$ cat /etc/krb5.conf
[libdefaults]
        default_realm = COMAPNYNAME.LOCAL

在以前的安装中,我认为[realms]在安装过程中还需要其他内容,但是我不记得是什么,这次也没有要求。

我的smb.conf

[global]

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
   workgroup = COMPANYNAME
   client signing = yes
   client use spnego = yes
   kerberos method = secrets and keytab
   realm = COMPANYNAME.LOCAL
   security = ads

我的sssd.conf

kyle@Server21:~$ sudo cat /etc/sssd/sssd.conf
[sssd]
services = nss, pam
config_file_version = 2
domains = COMPANYNAME.LOCAL

[domain/COMPANYNAME.LOCAL]
id_provider = ad
access_provider = ad
override_homedir = /home/%d/%u

尽管SSSD服务似乎无法启动:

kyle@Server21:~$ systemctl status sssd.service
● sssd.service - System Security Services Daemon
   Loaded: loaded (/lib/systemd/system/sssd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2016-06-22 09:57:57 EDT; 37min ago
  Process: 16027 ExecStart=/usr/sbin/sssd -D -f (code=exited, status=1/FAILURE)

Jun 22 09:57:55 Server21 sssd[16038]: Starting up
Jun 22 09:57:55 Server21 sssd[16041]: Starting up
Jun 22 09:57:55 Server21 sssd[16042]: Starting up
Jun 22 09:57:56 Server21 sssd[be[16043]: Starting up
Jun 22 09:57:57 Server21 sssd[be[16043]: Failed to read keytab [default]: No such file or directory
Jun 22 09:57:57 Server21 sssd[16031]: Exiting the SSSD. Could not restart critical service [COMPANYNAME.LOCAL].
Jun 22 09:57:57 Server21 systemd[1]: sssd.service: Control process exited, code=exited status=1
Jun 22 09:57:57 Server21 systemd[1]: Failed to start System Security Services Daemon.
Jun 22 09:57:57 Server21 systemd[1]: sssd.service: Unit entered failed state.
Jun 22 09:57:57 Server21 systemd[1]: sssd.service: Failed with result 'exit-code'.

并且由于该指南指出所有权和权限很重要:

kyle@Server21:~$ sudo ls -la /etc/sssd
total 12
drwx--x--x   2 sssd sssd 4096 Jun 21 14:34 .
drwxr-xr-x 103 root root 4096 Jun 22 10:21 ..
-rw-------   1 root root  172 Jun 21 14:22 sssd.conf

我的nsswitch.conf

kyle@Server21:~$ cat /etc/nsswitch.conf
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat sss
group:          compat sss
shadow:         compat sss
gshadow:        files

hosts:          files dns
networks:       files

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

netgroup:       nis sss
sudoers:        files sss

我的hosts

kyle@Server21:~$ cat /etc/hosts
127.0.0.1       localhost
127.0.1.1       Server21.COMPANYNAME.LOCAL Server21
192.168.11.11   Server21.COMPANYNAME.LOCAL Server21

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

这是麻烦开始的地方。使用sudo运行kinit在以下结果:

kyle@Server21:~$ sudo kinit adminstrator
kinit: Client 'adminstrator@COMPANYNAME.LOCAL' not found in Kerberos database while getting initial credentials

如果我放弃,它将进行身份验证sudo

kyle@Server21:~$ kinit -V administrator
Using default cache: /tmp/krb5cc_1000
Using principal: administrator@COMPANYNAME.LOCAL
Password for administrator@COMPANYNAME.LOCAL:
Authenticated to Kerberos v5

我可以验证票证:

kyle@Server21:~$ klist
Ticket cache: FILE:/tmp/krb5cc_1000
Default principal: administrator@COMPANYNAME.LOCAL

Valid starting       Expires              Service principal
06/23/2016 13:41:55  06/23/2016 23:41:55  krbtgt/COMPANYNAME.LOCAL@COMPANYNAME.LOCAL
        renew until 06/24/2016 13:41:48

但是当我尝试加入域时:

kyle@Server21:~$ sudo net ads join -k
Failed to join domain: failed to lookup DC info for domain 'COMPANYNAME.LOCAL' over rpc: An internal error occurred.

我以前收到过NT_STATUS_UNSUCCESSFUL指南中提到的消息,但是能够通过修改hosts文件来解决。

该指南讨论有关验证计算机帐户是否在Active Directory中创建的问题。我的管理员说他可以看到这台机器,所以我认为还可以。第二个验证选项没有告诉我应该从该命令中得到什么,但是我什么也没收到,因此我想它不起作用。

那我在哪里错了?


编辑:

我不确定自己做了什么,但是SSSD正在运行。


Ubuntu 14.04使用了新贵,而不是systemd。那输出是可疑的。
muru

@muru抱歉打错了。我在16.04。问题已被编辑。
Embedded.kyle

Answers:


3

问题似乎是我的管理员在域控制器上为此服务器创建了一个条目。这显然引起了冲突,导致Kerberos在尝试加入时遇到以下错误:

kyle@Server21:~$ sudo net ads join -k
Failed to join domain: failed to lookup DC info for domain 'COMPANYNAME.LOCAL' over rpc: An internal error occurred.

我不确定这个错误是否完全正确,因为我的管理员说服务器端已加入该域,并realmd表示我也已加入:

kyle@Server21:~$ realm join COMPANYNAME.LOCAL
realm: Already joined to this domain

我为获得成功的Kerberos连接所遵循的步骤如下:

  1. 管理员删除了域控制器中的条目
  2. 使用以下命令重新运行Kerberos配置: sudo dpkg-reconfigure krb5-config
  3. 选择的选项在配置中明确添加域控制器到[realms]krb5.conf
  4. 更改主机名以确保创建新记录
  5. 使用提取新票证 kinit
  6. 已使用加入域 sudo net ads join -k

最后结果:

kyle@SERV21:~$ sudo net ads join -k  
Using short domain name -- COMPANYNAME  
Joined 'SERV21' to dns domain 'CompanyName.Local'

0

我认为您缺少按键表。您可以通过kadmin工具创建它。键入kadmin,并在提示符下键入help以查看如何添加密钥表。


/etc/krb5.keytab已经存在,并且有一些加密的内容散布在服务器名称和域名之间。我需要再创建一个吗?
Embedded.kyle
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.