Adding centos to windows domain

Giridharaprasad
1 min readJan 12, 2018

--

Just noting out the steps to add a linux server to the existing windows domain.

Make sure that the windows domain controller is up and running.

1.Install the below packages in the centos box

yum install sssd realmd oddjob oddjob-mkhomedir adcli samba-common samba-common-tools krb5-workstation openldap-clients policycoreutils-python -y

2.Update /etc/resolv.conf with the DNS server’s IP address to which you wish to join.

search <Domain name>
nameserver <DNS IP>

3.Modify host name of centos box in /etc/hostname file

4.Update DNS ip in /etc/sysconfig/network-scripts/ifcfg-XXX file also. Else, resolv.conf will not retain the DNS entry in /etc/resolv.conf

5.Now, you have to add the host to the domain. This can be done through `realm-join` command,

realm join --user=Administrator <Domain-name>
Password for administrator:

Verify `realm list` to confirm if it is successfully joined.

Check nslookup to ensure if it resolves,

`root@giri-centos1 ~]# nslookup google.com
Server: 20.10.21.21
Address: 20.10.21.21#53
Non-authoritative answer:
Name: google.com
Address: 216.58.196.110`

If you want to remove the centos box from the domain, simply run `realm leave` command as follows:

`realm leave <Domain name>`

--

--

Giridharaprasad
Giridharaprasad

Written by Giridharaprasad

Software Engineer at Mayadata Inc.

No responses yet