DEV Community

Or Yaacov
Or Yaacov

Posted on

How to easily join Linux asset to AD

Syncing a Linux machine with Active Directory unlock benefits like seamless AD login, simplified asset management, and integrate your Linux machine into your company's existing environment, Here is a simple guide of how to do it :)

Image description

RPM Based Distributions (Centos/RHEL)

Setup dependencies
centos7:

yum install sssd realmd oddjob oddjob-mkhomedir adcli samba-common samba-common-tools krb5-workstation openldap-clients policycoreutils-python
Enter fullscreen mode Exit fullscreen mode

centos8:

yum install sssd realmd oddjob oddjob-mkhomedir adcli samba-common samba-common-tools krb5-workstation openldap-clients policycoreutils-python-utils
Enter fullscreen mode Exit fullscreen mode

Add to AD:

realm join --user=[domain user account] [domain name]
# realm join --user=myAdUser dev.com
Enter fullscreen mode Exit fullscreen mode

in case of error, run journalctl as described in the error, to fix KDC has no support for encryption type enable Kerberos encryption support:
update-crypto-policies --set DEFAULT:AD-SUPPORT

Debian based systems (ubuntu)

Setup dependencies

sudo apt-get update
sudo apt-get install sssd-ad sssd-tools realmd adcli
Enter fullscreen mode Exit fullscreen mode

Add to AD:

sudo realm -v discover [domain name]
# sudo realm -v discover dev.com
sudo realm join --user=[domain user account] [domain name]
# realm join --user=myAdUser dev.com
Enter fullscreen mode Exit fullscreen mode

in case of error, run journalctlas described in the error, to fix realm: Couldn't join realm: Necessary packages are not installed: sssd-tools sssd libnss-sss libpam-sss adcli even that they are installed run the following:

realm join --user=[domain user account] [domain name] --install=/
realm join --user=myAdUser dev.com
Enter fullscreen mode Exit fullscreen mode

Sources

Top comments (0)