https://akhnoto.wordpress.com/2013/10/18/join-domain-centos-6/1. Firstly, install the necessary components.
[root@localhost ~]# yum install -y samba-winbind samba-winbind-clients oddjob-mkhomedir pam_krb5 krb5-workstation
2. Make sure OddJobd is running at Startup. This is only for Red Hat Enterprise Linux 6 and other Red Hat based Operating systems.
[root@localhost ~]# chkconfig oddjobd on
Set authconfig to point to the relevant systems for Authentication.
Note: If you do not wish your users to log into your server via a shell, set –winbindtemplateshell to –winbindtemplateshell=/sbin/nologin
[root@localhost ~]# authconfig --update --kickstart --enablewinbind --smbsecurity=ads --smbworkgroup=DOMAIN --smbrealm=DOMAIN.COM --winbindtemplatehomedir=/home/%U --winbindtemplateshell=/bin/bash --enablewinbindusedefaultdomain --enablelocauthorize --enablekrb5 --krb5realm=DOMAIN.COM --enablekrb5kdcdns --enablekrb5realmdns --enablepamaccess
3. Just like in Windows, Add your system to the domain. Here I have used the Domain Administrator account, but any account with enough rights to add a system to the domain will suffice.
[root@localhost ~]# net ads join -U Administrator
4. Add localhost to dns server
[root@localhost ~]# net ads join -U Administrator
5. Restart Winbind service
[root@localhost ~]# service winbind restart
6. Create a Kerberos keytab to enable Single Sign On (SSO)
[root@localhost ~]# net ads keytab create -U Administrator
7. Test configuration. If you receive no output for a known username, then something is wrong.
[root@localhost ~]# getent passwd Administrator
[root@localhost ~]# wbinfo -u
[root@localhost ~]# wbinfo -g
8. This is optional, your home directory will not exist on the system when a new user logs in, run the below command if you with to have the homedir automatically created on first login.
[root@localhost ~]# authconfig --enablemkhomedir --update