Linux Winbind + MS Windows AD:一些可能的错误与需要注意的点
一、cannot join as standalone machine
在执行Linux加入MS Windows的AD的时候,你可能会遇到如题所示的错误。
具体情况如下:
1 2 3 |
[root@linuxme ~]# net join -D adamhuan.com -S mswinme.adamhuan.com -U adamhuan cannot join as standalone machine [root@linuxme ~]# |
造成这个问题的原因是,你没有配置本地的验证方式。
你需要先执行“setup”配置一下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
authconfig-tui - (c) 1999-2005 Red Hat, Inc. ┌────────────────┤ Authentication Configuration ├─────────────────┐ │ │ │ User Information Authentication │ │ [ ] Cache Information [ ] Use MD5 Passwords │ │ [ ] Use LDAP [*] Use Shadow Passwords │ │ [ ] Use NIS [ ] Use LDAP Authentication │ │ [ ] Use IPAv2 [ ] Use Kerberos │ │ [*] Use Winbind [*] Use Fingerprint reader │ │ [*] Use Winbind Authentication │ │ [*] Local authorization is sufficient │ │ │ │ ┌────────┐ ┌──────┐ │ │ │ Cancel │ │ Next │ │ │ └────────┘ └──────┘ │ │ │ │ │ └─────────────────────────────────────────────────────────────────┘ <Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen |
注意,选择:
Use Winbind
Use Winbind Authentication
这样配置之后,启动winbind:
1. yum install samba-winbind
2. service winbind start
再执行加入AD的操作就应该不会报“standalone”的错误了。
二、No DNS domain configured for linuxme. Unable to perform DNS Update.
这个错误发生在加入AD成功后,具体表现如下:
1 2 3 4 5 6 7 |
[root@linuxme ~]# net join -w ADAMHUAN -S mswinme.adamhuan.com -U adamhuan Enter adamhuan's password: Using short domain name -- ADAMHUAN Joined 'LINUXME' to dns domain 'adamhuan.com' No DNS domain configured for linuxme. Unable to perform DNS Update. DNS update failed! [root@linuxme ~]# |
如上所示:
1. AD的加入成功了。
2. DNS没有本机linuxme的解析。
对于这个错误,只需要在DNS解析中加入一条针对主机的A记录即可。
验证:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
[root@linuxme ~]# nslookup > > server 10.158.1.152 Default server: 10.158.1.152 Address: 10.158.1.152#53 > > mswinme.adamhuan.com Server: 10.158.1.152 Address: 10.158.1.152#53 Name: mswinme.adamhuan.com Address: 10.158.1.152 > > linuxme.adamhuan.com Server: 10.158.1.152 Address: 10.158.1.152#53 Name: linuxme.adamhuan.com Address: 10.158.1.111 > > exit [root@linuxme ~]# |
三、加入AD的时候,如果不指定DNS,那么可以编辑/etc/hosts,让客户端可以找到域控主机,如下:
1 2 3 4 5 6 7 8 9 10 |
[root@linuxme ~]# cat /etc/hosts # Local 127.0.0.1 localhost # Public 10.158.1.111 linuxme 10.158.1.152 mswinme.adamhuan.com [root@linuxme ~]# |
————————————————
与Linux 加入 AD 是否成功有关的主要服务是:Winbind。
其他的影响因素包括:
iptables
ip6tables
selinux
当相关配置变更的时候,可能需要重启winbind服务,以应用最新变更。
————————————————
Done。