Integrating a Linux Machine into Windows Active Directory Domain

The problem of integrating an Ubuntu workstation with Windows Active directory is quite common. Below we describe the required steps to help DataSunrise users accomplish this task:

 

1. Specify the name of the configured computer in the /etc/hostname file

Query the current host name:

cat /etc/hostname

If necessary, specify a new host name:

echo myhost > /etc/hostname

Note. Host name cannot be localhost, because localhost is the name for 127.0.0.1 (specified in the /etc/hosts file when you install the operating system).

 

2. Specify full domain controller name in the /etc/hosts file

Add a static record with full domain controller name in the end of the file /etc/hosts. Translation between IP address and the name of the computer is required so that you could use hostname instead of the IP address.

echo 192.168.1.51 hostname.db.local hostname >> /etc/hosts
 

3. Set a DNS server on the configured computer

Domain controller should be the first option for search (use nslookup command for check)

nslookup www.google.com
Server:         192.168.1.51
Address:        192.168.1.51#53
 
Non-authoritative answer:
Name:   www.google.com
Address: 216.58.201.163
 

4. Install a Kerberos client

sudo apt-get install krb5-user libpam-krb5 libpam-ccreds auth-client-config
 

5. Install Samba, Winbind and NTP

sudo apt-get install samba winbind ntp
 

6. Edit the /etc/kerberos/krb5.conf file to add full domain name, domain controller name and the realm parameter

[libdefaults]
    default_realm       =           DB.LOCAL    # domain specific parameter (full domain name)
    clockskew           =           300
    ticket_lifetime     =           1d
    forwardable         =           true
    proxiable           =           true
    dns_lookup_realm    =           true
    dns_lookup_kdc      =           true
   
 
   [realms]
        DB.LOCAL = {
        kdc            =       hostname.db.local   # domain specific parameter (domain controller name)
        admin_server   =       hostname.db.local   # domain specific parameter (domain controller name)
        default_domain =       DB.L