Join in Active Directory Domain2019/07/12 |
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.
|
|||||||||||
[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 # If DHCP server is running, select [Yes], if not, select [No] +----------------------+ Samba server and utilities +-----------------------+ | | | If your computer gets IP address information from a DHCP server on the | | network, the DHCP server may also provide information about WINS servers | | ("NetBIOS name servers") present on the network. This requires a change | | to your smb.conf file so that DHCP-provided WINS settings will | | automatically be read from /var/lib/samba/dhcp.conf. | | | | The dhcp-client package must be installed to take advantage of this | | feature. | | | | Modify smb.conf to use WINS settings from DHCP? | | | | <Yes> <No> | | | +---------------------------------------------------------------------------+ # specify Realm Name +------------------+ 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 AD DS Hostname +------------------+ 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 AD DS Hostname +------------------+ 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 Active Directory Domain. |
nameserver
10.0.0.100
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: # AD Administrator's password
# make sure it's possible to get an AD user info root@dlp:~# id FD3S01\\Serverworld uid=880001106(serverworld@srv.world) gid=880000513(domain users@srv.world) groups=880000513(domain users@srv.world),880000572(denied rodc password replication group@srv.world),880000512(domain admins@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:~#
root@dlp:~# systemctl restart sssd id Administrator uid=880000500(administrator) gid=880000513(domain users) groups=880000513(domain users),880000572(denied rodc password replication group),880000519(enterprise admins),880000512(domain admins),880000518(schema admins),880000520(group policy creator owners) |