Migrating Samba0 NT4 Domain To Samba AD
Migrating Samba0 NT4 Domain To Samba AD
Migrating Samba0 NT4 Domain To Samba AD
Content
1 Summary
2 Introduction
3 Migration Guide
o 3.1 Previous steps
o 3.2 About the infrastructure to use in migration
o 3.3 Executing the migration
o 3.4 Integrating AD into existing infrastructure
3.4.1 IP Change
3.4.2 DNS server integration
4 Sources
Summary
Migration of NT4 Domain over Samba3 to an AD domain with Samba4 and integration into the
existing infrastructure for a transparent server change in clients
Introduction
Samba4 enables the configuration of an Active Directory domain with Linux servers. In most
cases, the most common issue is about migrating an existing NT4 domain with hundreds of
clients connected to an AD Domain with the greatest possible transparency for each client. This
guide exempts even from changing DNS server to each client. The keys are the change of server
IP and the integration of the DNS domain minsal.psalud.gob.sv as a subdomain within the
psalud.gob.sv domain of the existing infrastructure.
Migration guide
Previous steps
The system charset is configured correctly, which comes to be "just as you are supposed
to want". In my particular case I configure es_SV.UTF-8 as explained here
Update the system before installing: Aptitude in Debian Jessie is behaving badly when
resolving dependencies when the system is outdated.
We created a directory to store the files that made up the NT domain of samba3.
We transfer these files to the AD server, in the example, from being in AD we execute:
Seriously, we make sure there is no related service (In Debian it seems that Samba Server tries to
function as samba 3)
The installation process has created some files that we do not need in the way they were
configured by default:
rm /etc/samba/smb.conf
rm -r / var / lib / samba / private / * tdb
PDC server
We turn off the old server to the samba service and take it out of the boot with the system startup
in case the doubts
Part of the necessary configuration for the domain is read from the file /etc/samba/smb.conf
that we brought from the PDC server. Then, it will be necessary to verify two things:
netbios name corresponds to the host name of the current ad server. In that case, the
server is called ad
netbios name = ad
passdb backend must refer to an IP from which the LDAP server of the PDC server can
be accessed
In the most recent versions of Debian, there is an error with the previous command, by which
winbindd is written instead of winbind in server services , which will have to be modified
manually. In general terms, the configuration file is very short and simple, something like the
following:
# Global parameters
[global]
workgroup = HEALTH.GOB.SV
realm = minsal.salud.gob.sv
netbios name = AD
server role = active directory domain controller
server services = s3fs, rpc, nbt, wrepl, ldap, cldap, kdc, drepl,
winbind, ntp_signd, kcc, dnsupdate
idmap_ldb: use rfc2307 = yes
[netlogon]
path = /var/lib/samba/sysvol/minsal.salud.gob.sv/scripts
read only = No
[sysvol]
path = / var / lib / samba / sysvol
read only = No
If you need to restart the process due to errors such as duplicate SIDs or duplicate user / group
names, delete deleted files with
With --verbose we will see infinity of information that could be useful to save, however, a
fragment that in fact contains extremely sensitive information could be overlooked, and goes as
follows:
We verify the version of bind9 installed, with Debian Jessie being 9.9.5 and verify that the
corresponding library is referenced in /var/lib/samba/private/named.conf :
Then we configure bind9 with the following file, but it will be possible to make other changes
that are considered necessary. It is enough to consider that for the dynamic zone to work, it must
be on the same computer where it is samba, on the other hand, the queries that the Windows
clients make to the DNS are configured as norecursive .
auth-nxdomain yes;
directory "/ var / lib / bind /";
notify no;
empty-zones-enable no;
tkey-gssapi-keytab "/var/lib/samba/private/dns.keytab";
allow-query {
127.0.0.1;
192.168.2.0/24;
# add other networks you want to allow to query your DNS
};
allow-recursion {
192.168.2.0/24;
# add other networks you want to allow to do recursive queries
};
forwarders {
# Google public DNS server here - replace with your own if necessary
192.168.2.4;
};
allow-transfer {
# this config is for a single master DNS server
none;
};
};
zone "0.0.127.in-addr.arpa" {
type master;
file "master / 0.0.127.zone";
};
CONF
\ $ ORIGIN localhost.
@ 1D IN SOA @ root (
2013050101; serial
8H; refresh
2H; retry
4W; expiry
1D; minimum
)
@ IN NS @
IN A 127.0.0.1
CONF
The reverse zone for localhost
IN NS localhost.
1 IN PTR localhost.
CONF
Restart service
Apr 21 12:46:05 named directory [1032]: generating session key for dynamic
DNS
Apr 21 12:46:05 named directory [1032]: sizing zone task pool based on 2
zones
Apr 21 12:46:05 named directory [1032]: Loading 'AD DNS Zone' using driver
dlopen
Apr 21 12:46:06 named directory [1032]: samba_dlz: started for DN DC =
minsal, DC = psalud, DC = gob, DC = sv
Apr 21 12:46:06 named directory [1032]: samba_dlz: starting configure
Apr 21 12:46:06 named directory [1032]: samba_dlz: configured writeable zone
'minsal.psalud.gob.sv'
Apr 21 12:46:06 named directory [1032]: samba_dlz: configured writeable zone
'_msdcs.minsal.psalud.gob.sv'
Apr 21 12:46:06 named directory [1032]: set up managed keys zone for view
_default, file 'managed-keys.bind'
Apr 21 12:46:06 named directory [1032]: command channel listening on
127.0.0.1 # 953
Apr 21 12:46:06 named directory [1032]: command channel listening on :: 1 #
953
With the DNS server already functional, the server must be configured as its own DNS
server in /etc/resolve.conf . Neglecting this is a significant part of the headaches that the
internet forums are full of ( Cannot find KDC for realm "PSALUD.GOB.SV" while getting
initial credentials is the most common).
To configure kerberos with the file created by the migration wizard, simply create a symbolic
link:
A healthy record (Except for the problem with cups) occurs as follows:
We check that our kerberos kingdom is online, using the password we have collected before
kinit [email protected]
If the previous command occurs without problems (it returns nothing), we can use the samba4
tools to check the DNS records.
At this point, you have an AD server with fully functional samba4. If you attend to the DNS
address, at this point it is already possible that all those services that authenticate against
the LDAP server can change their configuration .
Considering computers within the old NT domain with samba3, if the server we are going to
migrate acquires the new IP, the transition will be completely transparent. Consider that this
transition is irreversible, which, although it is a good thing, forces us to test this guide in an
isolated network environment.
PDC server
At this point in life, we have samba off. But now we have to say goodbye forever to our Samba
server. Instead of drama, just change your IP to use it on the new Samba server.
AD server
We add the ip to the flight. We need the other IP to be available because there are many
operations that are carried out against it.
samba_dnsupdate --verbose
The output is extremely extensive, but basically you have to look at each point where Failed
says :
The best proof that it has worked is that when you run that command again, there are no major
changes and towards the end of all the output the command returns:
We turn off a moment to samba while we make the changes systemctl stop samba-ad-dc.service
We change the IP for the system. In Debian, just modify /etc/hosts and
/etc/network/interfaces . We last /etc/resolv.conf that in /etc/resolv.conf it points
to the same server as DNS
We check the status of our connection to the system, if we were connected remotely
This can be a little trick. To join new computers in the domain, it will be enough to have a DNS
server configured that resolves all the entries related to the operation of AD. Now, to save the
step of having to configure the network, this may be the procedure you want to follow. DNS
server
We add in the file /etc/bind/named.conf.default-zones (Or wherever the zones are added in our
DNS configuration) a slave zone as follows:
zone "minsal.psalud.gob.sv" {
type slave;
file "/var/lib/bind/minsal.psalud.gob.sv.db";
allow-transfer {10.30.20.49/32;};
masters {10.30.20.49;};
};
touch /var/lib/bind/minsal.psalud.gob.sv.db
chown bind: bind /var/lib/bind/minsal.psalud.gob.sv.db
We can test this configuration when executing a non-recursive DNS query against the given
server. A computer external to the DNS would be your best option