dotlinux blog

Joining CentOS 7 Desktop to Zentyal PDC (Primary Domain Controller)

In a corporate or technical environment, it's often necessary to integrate different systems into a unified domain infrastructure for better management, security, and user experience. Zentyal is a powerful open - source platform that can serve as a Primary Domain Controller (PDC), offering features like user and group management, file sharing, and authentication services. CentOS 7 is a popular Linux distribution known for its stability and reliability. This blog post will guide you through the process of joining a CentOS 7 desktop to a Zentyal PDC, allowing users to log in to the CentOS 7 machine using domain - based credentials.

2026-06

Table of Contents#

  1. Prerequisites
  2. Setting up Network and DNS Configuration on CentOS 7
  3. Installing Required Packages on CentOS 7
  4. Configuring Realmd on CentOS 7
  5. Joining the CentOS 7 Desktop to the Zentyal PDC
  6. Testing the Domain Join
  7. Troubleshooting Tips
  8. Conclusion
  9. References

Prerequisites#

  • A running Zentyal PDC with active directory integration enabled. You should have administrative access to the Zentyal server and know the domain name (e.g., example.com).
  • A CentOS 7 desktop machine with internet access to install necessary packages.
  • Basic knowledge of Linux command - line operations.

Setting up Network and DNS Configuration on CentOS 7#

  1. Static IP Configuration
    • Edit the network configuration file for the network interface. For example, if your interface is eth0, you can edit the file /etc/sysconfig/network-scripts/ifcfg-eth0.
      sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0
    - Set the following parameters:
    ```plaintext
    TYPE=Ethernet
    BOOTPROTO=none
    DEFROUTE=yes
    PEERDNS=yes
    PEERROUTES=yes
    IPV4_FAILURE_FATAL=no
    IPV6INIT=yes
    IPV6_AUTOCONF=yes
    IPV6_DEFROUTE=yes
    IPV6_PEERDNS=yes
    IPV6_PEERROUTES=yes
    IPV6_FAILURE_FATAL=no
     IPV6_ADDR_GEN_MODE=stable-privacy
     NAME=eth0
     UUID=<your-network-interface-uuid>
     DEVICE=eth0
     ONBOOT=yes
     IPADDR=<your-static-ip-address>
     NETMASK=<your-netmask>
     GATEWAY=<your-gateway-ip>
     DNS1=<zentyal-dns-ip>
    
    • Replace <your-network-interface-uuid>, <your-static-ip-address>, <your-netmask>, <your-gateway-ip>, and <zentyal-dns-ip> with the appropriate values.
    • Save and exit the file.
    • Restart the network service:
      sudo systemctl restart network
  2. Verify DNS Resolution
    • Use the nslookup command to check if you can resolve the domain name of the Zentyal PDC.
       nslookup <your-zentyal-domain-name>
    • If the command returns the correct IP address of the Zentyal server, DNS resolution is working correctly.

Installing Required Packages on CentOS 7#

  1. Enable EPEL Repository
    • The Extra Packages for Enterprise Linux (EPEL) repository provides additional packages that are not available in the default CentOS repositories.
      sudo yum install epel-release
  2. Install SSSD, Realmd, and Other Dependencies
    • SSSD (System Security Services Daemon) is used to manage user authentication and authorization. Realmd simplifies the process of joining a machine to a domain.
      sudo yum install sssd realmd samba-common-tools oddjob oddjob-mkhomedir adcli

Configuring Realmd on CentOS 7#

  1. Discover the Domain
    • Use the realm discover command to find the Zentyal domain.
      sudo realm discover <your - zentyal - domain - name>
    • This command should display information about the domain, such as the domain name, domain controllers, and available services.
  2. Edit the Realmd Configuration
    • Edit the /etc/realmd.conf file to configure realm - specific settings.
      sudo nano /etc/realmd.conf
    • Add the following lines:
       

[active-directory] default-client-software = sssd os-name = CentOS Linux os-version = 7

[users] default-home = /home/%D/%U default-shell = /bin/bash

[] fully-qualified-names = no automatic-id-mapping = yes user-home-directory = /home/%D/%U user-shell = /bin/bash ```

  • Replace <your-zentyal-domain-name> with the actual domain name.
  • Save and exit the file.

Joining the CentOS 7 Desktop to the Zentyal PDC#

  1. Join the Domain
    • Use the realm join command to join the CentOS 7 machine to the Zentyal PDC. You will need to provide the credentials of a domain administrator.
      sudo realm join -U <domain-administrator-username> <your-zentyal-domain-name>
    • Enter the password for the domain administrator when prompted.
    • If the join is successful, you should see a message indicating that the machine has been joined to the domain.

Testing the Domain Join#

  1. List Domain Users and Groups
    • Use the getent passwd and getent group commands to list domain users and groups.
      getent passwd
      getent group
    • You should see the domain users and groups in the output.
  2. Log in as a Domain User
    • Log out of the local user session and try to log in using a domain user account at the graphical login screen or the console.
    • If the login is successful, the domain join was completed successfully.

Troubleshooting Tips#

  • DNS Issues: If you are unable to discover the domain, double - check your DNS configuration on the CentOS 7 machine. Make sure the DNS server IP is set to the Zentyal server's IP.
  • Firewall Issues: Ensure that the necessary ports are open on both the CentOS 7 machine and the Zentyal server. For example, ports 53 (DNS), 88 (Kerberos), 135 (RPC), 139 (NetBIOS), 389 (LDAP), 445 (SMB), and 636 (LDAPS) may be required.
  • Authentication Issues: If you are unable to log in as a domain user, check the user's account status in the Zentyal PDC and make sure the password is correct.

Conclusion#

Joining a CentOS 7 desktop to a Zentyal PDC allows for centralized user management and authentication, enhancing the security and manageability of your network. By following the steps outlined in this blog post, you should be able to successfully integrate your CentOS 7 machine into the Zentyal domain infrastructure.

References#