How To: Samba4 AD PDC + Windows XP, Vista and 7
If you've been struggling with Samba3 domain controllers and NT4 style domains working with Windows7 (or Vista) you are not alone. Various work arounds and hacks exist for the 3.3, 3.4, 3.5 and 3.6 series of Samba to make this go. Our experience (50+ installs) has been intermittent success, with seemingly random failures (Trust relationships, &c).
Move forward to Samba4
Pre-requsites
For Samba4 to operate properly you'll need to have a properly running DHCP/DNS (dnsmasq) and as well as NTP (openntpd). The DHCP/DNS services don't necessarily have to run on the Samba server but the NTP should be running on the domain controller.
Installing Samba4
It's crazy easy on Gentoo/Praxis - still easy on Ubuntu. Use the latest git master for the best success.
Gentoo Based
~ # echo "=net-fs/samba-4.0.0_alpha11" >> /etc/portage/package.unmask
~ # export USE="readline smbclient sqlite threads"
~ # ACCEPT_KEYWORDS="~amd64" emerge -av =net-fs/samba-4.0.0_alpha11
[ebuild R ] sys-libs/talloc-2.0.7 USE="-compat python*" 0 kB
[ebuild N ] sys-libs/tevent-0.9.16 484 kB
[ebuild U #] net-fs/samba-4.0.0_alpha11 [3.5.15] USE="(-acl%*) (-addns%) (-ads%) (-aio%*) (-avahi%) -caps client (-cluster%) (-cups%) -debug (-doc%) -dso% (-examples%) (-fam%) -gnutls% (-ldap%*) (-ldb%) netapi (-pam%*) python%* (-quota%) (-readline%*) server (-smbclient%*) (-smbsharemodes%) (-smbtav2%) -sqlite% (-swat%) (-syslog%*) -threads% tools%* (-winbind%)" 13,592 kB
Ubuntu Based
~ # apt-get install build-essential libacl1-dev python-dev libldap2-dev pkg-config gdb libgnutls-dev libblkid-dev libreadline-dev libattr1-dev
~ # git clone git://git.samba.org/samba.git /usr/src/samba4/
~ # cd /usr/src/samba4
~ # ./configure --enable-debug
~ # make
~ # make install
~ # export PATH="/usr/local/samba/sbin:/usr/local/samba/bin:$PATH"
Provision Samba4
Run the simple provision command to create a new Active Directory style domain.
~ # provision \
--realm=domain.lan --domain=nt4dom \
--server-role=dc \
--dns-backend=NONE \ SAMBA_INTERNAL
--adminpass='Cl3verG1rl'
If you get a message like this:
ProvisioningError: Your filesystem or build does not support posix ACLs, which s3fs requires. Try the mounting the filesystem with the 'acl' option.
You'll need to fix those to proceed, either with --use-ntvfs or mounting your FS with ACLs in place.
--use-ntvfs
Really you should fix your file system.
DNS Updates for dnsmasq §
Most of the documentation points to using Bind9 as the DNS system for your Active Directory. I hate bind, so it's dnsmasq to the rescue.
AD depends on a number of special SRV and A/CNAME records to function nicely. So, in addition to the traditional host records from DHCP, or /etc/hostswe need to add this stuff to the configuration.
The variables here represent values for your environment, adjust as necessary. This is available as a script from edoceo.com/pub/samba4-dnsmasq-update.sh.
PDC="pdc"
IP4="10.65.0.3" DOMAIN="edoceo.lan"
NT4DOM="edoceo" ADHOST="${PDC}.${DOMAIN}"
ADGUID="00ed0ce0-1234-4321-4444-d5a81a980958"
ADSITE="default-first-site-name" address=/${ADGUID}._msdcs.${DOMAIN}/$IP4
# address=/${ADGUID}._msdcs.${DOMAIN}/$IP6
address=/gc._msdcs.${DOMAIN}/$IP4
# address=/gc._msdcs.${DOMAIN}/$IP6
address=/kerberos.${DOMAIN}/$IP4
# address=/kerberos.${DOMAIN}/$IP6 # Maybe Remove the Above for ADGUID? # Global Catalog
srv-host=_gc._tcp.${DOMAIN},${ADHOST},3268
srv-host=_gc._tcp.${ADSITE}._sites.${DOMAIN},${ADHOST},3268 # Kerberos
# This is queried for, but I don't know which port to reply with
# srv-host=_kerberos._http.${DOMAIN},${ADHOST},80
srv-host=_kerberos._tcp.${DOMAIN},${ADHOST},88
srv-host=_kerberos._tcp.dc._msdcs.${DOMAIN},${ADHOST},88
srv-host=_kerberos._tcp.${ADSITE}._sites.${DOMAIN},${ADHOST},88
srv-host=_kerberos._tcp.${ADSITE}._sites.dc._msdcs.${DOMAIN},${ADHOST},88
srv-host=_kerberos._udp.${DOMAIN},${ADHOST},88 # kpasswd
srv-host=_kpasswd._tcp.${DOMAIN},${ADHOST},464
srv-host=_kpasswd._udp.${DOMAIN},${ADHOST},464 # LDAP Server
srv-host=_ldap._tcp.5e6c4f0e-995e-4ccb-ae97-9629e2be9130.domains._msdcs.${DOMAIN},${ADHOST},389
srv-host=_ldap._tcp.${ADSITE}._sites.dc._msdcs.${DOMAIN},${ADHOST},389
srv-host=_ldap._tcp.${ADSITE}._sites.${PDC}.${DOMAIN},${ADHOST},389
srv-host=_ldap._tcp.${ADSITE}._sites.${DOMAIN},${ADHOST},389
srv-host=_ldap._tcp.dc._msdcs.${DOMAIN},${ADHOST},389
srv-host=_ldap._tcp.${ADSITE}._sites.dc._msdcs.${DOMAIN},${ADHOST},389
srv-host=_ldap._tcp.${ADSITE}._sites.gc._msdcs.${DOMAIN},${ADHOST},389
srv-host=_ldap._tcp.${ADSITE}._sites.${DOMAIN},${ADHOST},389
srv-host=_ldap._tcp.gc._msdcs.${DOMAIN},${ADHOST},389
srv-host=_ldap._tcp.${PDC}._msdcs.${DOMAIN},${ADHOST},389
srv-host=_ldap._tcp.${PDC}.${DOMAIN},${ADHOST},389
srv-host=_ldap._tcp.${DOMAIN},${ADHOST},389
Start and Test Samba
Now start samba and then run a few tests against the server to see if it's OK.
~ # samba
~ # smbclient -L localhost -U%
~ # smbclient //localhost/netlogon -U 'administrator'
Testing from Windows
ipconfig /release
ipconfig /renew
ipconfig /all
net view /domain:$DOMAIN
net view \\$ADHOST
nbtstat -A $ADHOST_IP4
You should also download the Windows Server 2003 Service Pack 2 Administration Tools Pack. This gives you some tools such as dsa.msc.
wget http://download.microsoft.com/download/f/5/4/f541633c-6e89-4407-a69e-673dc7f2b485/WindowsServer2003-KB340178-SP2-x86-ENU.msi
Join Domain Clients
Windows XP, Vista, 7 and 8
Samba4 works with all these systems, Professional edition, and all join right up to the domain w/o needing any registry hacks or other tricks.
Join Samba3
Samba3 has no problem joining the Samba4 domain as a member server.
~ # net rpc join -U administrator member
Enter administrator's password:
Joined domain EDOCEO.
Caveats
Be wary of information in /etc/nsswitch.conf, /etc/krb5.conf....
No More Network Browsing §
In Windows based AD you can still browse a network, Samba3 had this but Samba4 does not. So, you will not see your domain, or browse machines in the domain.
Samba4 and Homes §
The [homes] share and the browseable directive don't work as expected.
Cannot contact any KDC for requested realm: unable to reach any KDC in realm $DOMAIN
This is a DNS related issue, it's likely the above SRV records are not present, fix your DNS.
ntptr_init_context: failed to find NTPTR providor='simple_ldb'
I don't know yet, doesn't seem to be fatal.
nbtd netlogon handler failed from 10.65.0.122:138 to REMOTE<1c> - NT_STATUS_BAD_NETWORK_NAME
This is save to ignore, provided that the IP address and the name (REMOTE) are referencing an old, previous or same-subnet domain. This is just a warning about a recieved netbios name that is being ignored cause it's not part of our AD.
See Also
- Samba4 Server Role
- Samba4 Howto
- Gentoo Wiki: Samba4 AD
- Samba3 to Samba4 Upgrade
- Samba4 PDC / Win7
- Samba3 on Samba4 Domain
- Resara Small Business Server
- nblookup.exe tool from microsoft
How To: Samba4 AD PDC + Windows XP, Vista and 7的更多相关文章
- 渗透杂记-2013-07-13 Windows XP SP2-SP3 / Windows Vista SP0 / IE 7
Welcome to the Metasploit Web Console! | | _) | __ `__ \ _ \ __| _` | __| __ \ | _ \ | __| | | | __/ ...
- Linux Versus Windows, Ubuntu/Mint V XP/Vista/7
原文:http://petermoulding.com/linux_versus_windows_ubuntu_mint_v_xp_vista_7 Linux Versus Windows, Ubun ...
- IETester for IE11, IE10, IE9, IE8, IE7 IE 6 and IE5.5 on Windows 8 desktop, Windows 7, Vista and XP
简介: IETester是一个免费的(用于个人和专业用途)WebBrowser,允许您在Windows 8桌面,Windows 7,Vista和XP上拥有IE11,IE10,IE9,IE8,IE7 I ...
- 【转】如何使用VS 2013发布一个可以在Windows XP中独立运行的可执行文件
问题描述: 用VS2013写好一个程序,在本机上运行一切正常.但是如果直接把exe文件放到另一台机器上用,则会出现: Windows XP:不是一个正常的win32程序 Window 7:缺少msvc ...
- 解决libcurl7.50.3在windows XP SP3 VC++ 6.0下编译报错 unresolved external symbol __imp__IdnToAscii@20 unresolved external symbol __imp__IdnToUnicode@20
错误重现: --------------------Configuration: curl - Win32 LIB Debug DLL Windows SSPI DLL WinIDN--------- ...
- 成功在神舟K650c-i7 d2(i7-4700MQ、HM87)上装好了Windows XP
成功在神舟K650c-i7 d2(i7-4700MQ.HM87)上装好了Windows XP 本来已经在K650c上装好了Windows7.Windows8双系统,奈何某些旧软件只能在Windows ...
- 3DSlicer源代码编译过程vs2008+windows xp [转]
一 下载QT源代码编译 1. 简述 在 Windows2000/xp/vista 下,安装 VS2008, QT 4.7.2 :并在 VS2008上建立 QT 的集成开发环境,利用 VS2008 ...
- PC-飞起来!我的Windows XP——五步快速优化Windows XP
虽然Microsoft的 Vista已经发售了快一年,但国内大部分系统用户仍使用着目前堪称完美的Windows XP.与以往的Windows操作系统一样,新安装的Windows XP可能还不在最佳状态 ...
- WinSetupFromUSB – Install Windows XP from USB Flash Drive
http://myeeeguides.wordpress.com/2008/11/15/winsetupfromusb-install-windows-xp-from-usb-flash-drive/ ...
随机推荐
- zip压缩命令的使用
file命令可以查看文件的类型 tar类型 .tar gzip类型 .gz bzip2类型 .bz2 zip类型 .zip 如果一个压缩文件由tar命令解压的前提,2个条件 1.这个文件 ...
- EXCEL 图表 只在拐点的时候显示数字
EXCEL图表只在折线的拐点显示数值,中间不需要显示.同时往下拐的,显示在上方,往上的显示在下方,这样数值不会挡住线. 首先,做一些模拟数据 因为起点和终点数值必须显示,所以单元格,C2 D2 C19 ...
- C# 学习电子书资料分享mobi epub等格式
.NET之美:.NET关键技术深入解析 作者: 张子阳 出版社:机械工业出版社 大小:20.29MB 出版时间:14-01-01 格式:mobi ASP.NET 4权威指南 作者: 马伟 出版社: 大 ...
- php 目录函数和日期函数
continue . break . exit目录函数opendir(); 打开一个文件夹is_file 只判断文件是否存在: file_exists 判断文件是否存在或者是目录是否存在: is_di ...
- C#在数据层过滤属性中的主键
C#使用泛型+反射做为数据层时,一个很都头疼的问题,如何让C#属性在程序里识别出哪个属性是主键,在拼接SQL时,不能把主键拼接到SQL语句里. 这个需要自定义一个属性.新建一个类文件,命名为Prosp ...
- 《C++primer》v5 第4章 表达式 读书笔记 习题答案
4.1 105 4.2 *vec.begin()=*(vec.begin())//先调用点运算符,再解引用 *vec.begin()+1=(*vec.begin())+1//先解引用,再加一 4.3略 ...
- 火狐浏览器不能获取 event,解决js报错问题
//←的keyCode等于:37 //→的keyCode等于:39 //↑的keyCode等于:38 //↓的keyCode等于:40 function keystoke(obj){ //var e ...
- cocos2d-x图层相关 锚点
CCLayerColor* ccc = CCLayerColor::create(ccc4(255,0,0,255)); ccc->setContentSize(CCSize(200,200)) ...
- SQLSERVER2008 不能用IP连接数据库问题
本机安装的数据库只能用电脑名+"\"+实例名来访问,用“.”.“(local)”.“localhost”呀都不能访问.然后在网上挖资料呀,挖呀挖呀,终于挖到了解决办法. 1.不能用 ...
- JS中直接从java后台获得对象的值(数组的值)
这里举得例子是:JS直接从后台Contorller中(SpringMVC中的model中)获得数值的值 Contorller 此处将 talentIntegralRecordsDay talentIn ...