Debian 9 Stretch
Sponsored Link

Join in Active Directory Domain2017/06/26

 
Join in Windows Active Directory Domain.
This tutorial needs Windows Active Directory Domain Service in your LAN.
This example shows to configure on the environment below.
Domain Server : Windows Server 2016
Domain Name : FD3S01
Realm : SRV.WORLD
Hostname : fd3s.srv.world
[1] Install some required packages.
root@dlp:~#
apt -y install realmd sssd sssd-tools adcli krb5-user packagekit samba-common samba-common-bin samba-libs resolvconf
# specify realm

 +------------------+ Configuring Kerberos Authentication +------------------+
 | When users attempt to use Kerberos and specify a principal or user name   |
 | without specifying what administrative Kerberos realm that principal      |
 | belongs to, the system appends the default realm.  The default realm may  |
 | also be used as the realm of a Kerberos service running on the local      |
 | machine.  Often, the default realm is the uppercase version of the local  |
 | DNS domain.                                                               |
 |                                                                           |
 | Default Kerberos version 5 realm:                                         |
 |                                                                           |
 | SRV.WORLD________________________________________________________________ |
 |                                                                           |
 |                                  <Ok>                                     |
 |                                                                           |
 +---------------------------------------------------------------------------+
# specify hostname of AD DS

     +--------------+ Configuring Kerberos Authentication +---------------+
     | Enter the hostnames of Kerberos servers in the SRV.WORLD           |
     | Kerberos realm separated by spaces.                                |
     |                                                                    |
     | Kerberos servers for your realm:                                   |
     |                                                                    |
     | fd3s.srv.world____________________________________________________ |
     |                                                                    |
     |                               <Ok>                                 |
     |                                                                    |
     +--------------------------------------------------------------------+
# specify hostname of AD DS

 +------------------+ Configuring Kerberos Authentication +------------------+
 | Enter the hostname of the administrative (password changing) server for   |
 | the SRV.WORLD Kerberos realm.                                             |
 |                                                                           |
 | Administrative server for your Kerberos realm:                            |
 |                                                                           |
 | fd3s.srv.world___________________________________________________________ |
 |                                                                           |
 |                                  <Ok>                                     |
 |                                                                           |
 +---------------------------------------------------------------------------+
[2] Join in Windows Active Directory Domain.
# change DNS setting to AD's one

root@dlp:~#
vi /etc/network/interfaces
dns-nameservers
10.0.0.100
root@dlp:~#
systemctl restart ifup@ens3 resolvconf
root@dlp:~#
vi /etc/pam.d/common-session
# add to the end if need (create home directory automatically at initial login)

session optional        pam_mkhomedir.so skel=/etc/skel umask=077

# discover Active Directory domain

root@dlp:~#
realm discover SRV.WORLD

srv.world
  type: kerberos
  realm-name: SRV.WORLD
  domain-name: srv.world
  configured: no
  server-software: active-directory
  client-software: sssd
  required-package: sssd-tools
  required-package: sssd
  required-package: libnss-sss
  required-package: libpam-sss
  required-package: adcli
  required-package: samba-common-bin

# join in Active Directory domain

root@dlp:~#
realm join SRV.WORLD

Password for Administrator:    
# Administrator's password
# make sure it's possible to get an AD user info

root@dlp:~#
id FD3S01\\Serverworld

uid=1066601000(serverworld@srv.world) gid=1066600513(domain users@srv.world) groups=1066600513(domain users@srv.world
# make sure it's possible to switch to an AD user

root@dlp:~#
su - FD3S01\\Serverworld

Creating directory '/home/serverworld@srv.world'.
serverworld@srv.world@dlp:~$    
# just switched
[3] If you'd like to omit domain name of AD user, configure like follows.
root@dlp:~#
vi /etc/sssd/sssd.conf
# line 16: change

use_fully_qualified_names =
False
root@dlp:~#
systemctl restart sssd

root@dlp:~#
id Administrator

uid=1066600500(administrator) gid=1066600513(domain users) groups=1066600513(domain users),
1066600518(schema admins),1066600572(denied rodc password replication group),
1066600520(group policy creator owners),1066600512(domain admins),1066600519(enterprise admins)
Matched Content