Samba 和 Windows 2003 Service Pack1 或者和含有"Post-Service Pack 4 Security Rollup"的Windows 2000 Service Pack4的兼容性问题?
解决方法:

当Windows 2003升级到Service Pack1, Windows 2000升级了"Post-Service Pack 4 Security Rollup",Windows 2000或者2003 域控制器(DC)和Samba的winbind之间的兼容性很快就显露出来了。红帽企业版Linux 3或者4 的Samba当前版本和之前的版本都存在这个问题。


已知问题

winbind已经明确的问题有:

  • Winbind在解析域SID到域用户名和组时解析失败,包括那些在信任域中但是没有安装Windows升级的域控制器(DC).

失败信息将会被记录在/var/log/samba/winbindd.log,例如:

[2005/04/29 19:07:06, 1] nsswitch/winbindd_user.c:winbindd_getpwuid(248)
  could not lookup sid S-1-5-21-1538550916-4051550271-1313386325-2000
  • 列出域中确实存在的组失败。失败信息将会被记录在/var/log/samba.winbindd.log,例如:
[2005/04/29 19:07:06, 1] nsswitch/winbindd_group.c:winbindd_getgrnam(298)
  group Domain Admins in domain TESTDOMAIN does not exist
  • 基于pam_winbind的系统认证有问题或者彻底失败.问题如下:

1.域用户名在控制台登陆可以通过pam_winbind的系统认证,但是用户名不能正确被查出,结果是已登陆用户在session中没有设定用户名.

2.pam_bind系统认证彻底失败.


上面所说的问题是已明确的winbind的问题. 当winbind启用时,Samba依赖于winbind提供的用户名和组名.因此,winbind不能正常工作的结果就是Samba出现问题,例如不能访问共享,或者基于域组的共享权限控制出现问题.


问题解决办法:

windows升级包指出winbind兼容性问题存在两种截然不同的组成部分。

  • 客户安全频道(client schannel, client secure channel)- Winbind再也不能够和安装了这些升级包的Windows 2000或者2003域控制器使用client schannel正确通信. Samba和winbind默认使用client schannel.
  • 匿名绑定(Anonymous binds)- Windows 2000和2003的域控制器安装这些升级包,将不再允许winbind通过匿名绑定去列出域用户和组信息.Winbind仿效传统windows操作系统的做法,默认匿名绑定DC。


Component Issue 1: client schannel

Samba开发者在Samba 3.0.14提供了一个patch,当Samba被加入到ADS(Active Directory Services)安全模式的域时,停止winbind使用client schannel. Red Hat在RHEL 3U6和RHEL 4U2上发布的samba升级包也包含这个patch.因此, 将Samba服务器加入到ADS安全模式的域的用户必须升级Samba, 或者使用下面提到的client schannel workaround以便解决这部分问题.


注意:patch只是在Samba servre加入到ADS安全模式下的Active Directory域时,禁止winbind使用schannel. Samba server加入到使用域安全模式(DOMAIN security mode)的Active Directory域,将需要使用下面提到的client schannel workaround, 甚至用到此时可以在[http://rhn。redhat。com 红帽网络]获得的最新的samba包

为了从[http://rhn。redhat。com 红帽网络]升级频道获得最新Samba包,已root身份运新以下命令:

# up2date samba samba-client samba-common
 
Fetching Obsoletes list for channel: rhel-i386-as-3...
 
Fetching rpm headers...
########################################
 
Name                                    Version        Rel
----------------------------------------------------------
samba                                   3.0.9          1.3E.7            i386
samba-client                            3.0.9          1.3E.7            i386
samba-common                            3.0.9          1.3E.7            i386
 
 
Testing package set / solving RPM inter-dependencies...
########################################
samba-3.0.9-1.3E.7.i386.rpm ########################## Done.
samba-client-3.0.9-1.3E.7.i ########################## Done.
samba-common-3.0.9-1.3E.7.i ########################## Done.
Preparing              ########################################### [100%]
 
Installing...
   1:samba-common           ########################################### [100%]
   2:samba                  ########################################### [100%]
   3:samba-client           ########################################### [100%]
[root@samba-vmsrv1 samba]#

client schannel Workaround

Samba server加入到域安全模式下的Active Directory域,或者没有升级服务器的samba包,将Samba服务器加入到ADS模式下的域,可以利用下面的workaround完全禁止Samba使用client schannel:

在/etc/samba/smb.conf的[global]段加入一项配置client schannel=no:

	[global]
	
	# W2K3-SP1 / W2K-SP4-SR1 COMPATIBILITY WORKAROUND
	# The following statement turns off Samba's attempts to use netlogon
	# schannel when connecting as a client to other SMB hosts.
	client schannel = no
	
	# GENERAL WINDOWS 2000, 2003, and XP-RELATED COMPATIBILITY SETTINGS
	# These two settings tend to improve Samba's compatibility with newer
	# Windows systems:
	client use spnego = no
	server signing = auto


Component Issue 2: 匿名绑定

如果域控制器已经安装了这些Windows升级包, winbind必须配置成使用正确的域用户帐号认证. 红帽 Knowledgebase其他的文章详细描述配置过程.

关于winbind配置的更多信息,请查看以下资源:

  • /usr/share/doc/samba-<version>目录下的samba文档, 每一安装samba RPM基本包的红帽系统都含有. 此目录下提供有插图的PDF和HTML格式的参考手册.
  • smb.conf man page, 运行man smb.conf命令即可看到.


相关解决方案

*How do I configure the Winbind service to authenticate itself so it is compatible with Windows domain controllers that restrict anonymous access to user and group information?