How to Join CentOS 7 Computer to an Active Directory Domain
Add BeyondTrust AD Bridge Open repository to your system.
sudo wget -O /etc/yum.repos.d/pbiso.repo http://repo.pbis.beyondtrust.com/yum/pbiso.repo
Once your Repository has been added, you can then install the BeyondTrust AD Bridge using the following commands.
sudo yum clean all
sudo yum install -y pbis-open
Do the following customization.
# Set domain prefix
sudo /opt/pbis/bin/config UserDomainPrefix <DOMAIN NETBIOS NAME>
Ex:
sudo /opt/pbis/bin/config UserDomainPrefix EXAMPLE
# Set default logon domain
sudo /opt/pbis/bin/config AssumeDefaultDomain True
# Set default login shell
sudo /opt/pbis/bin/config LoginShellTemplate /bin/bash
# Set home directory template
sudo /opt/pbis/bin/config HomeDirTemplate %H/%D/%U
Join the computer to the domain.
sudo domainjoin-cli join <DOMAIN NETBIOS NAME> <DOMAIN ADMIN USERNAME>
Ex:
sudo domainjoin-cli join EXAMPLE.LOCAL yasithab
Add domain user to the sudoers group.
sudo usermod -a -G sudo <DOMAIN USER>
Ex:
sudo usermod -a -G sudo shashikaj
Allow the above domain user to run sudo commands without entering the password.
# User rules for Domain User
<DOMAIN USER> ALL=(ALL) NOPASSWD:ALL
Ex:
shashikaj ALL=(ALL) NOPASSWD:ALL
In order to get domain information, run the following command.
sudo domainjoin-cli query
tip
If you want to remove your computer from the domain, you need to run:
sudo domainjoin-cli leave