This page will show you how to join your Linux server into the Active Directory domain, how to integrate the Active Directory user accounts into the Linux user accounts and how to authenticate users in Active Directory using Winbind, a component of Samba.
A better way to integrate Active Directory into your Linux mail server is by using Postfix’s Virtual User Accounts.
Samba is installed by default when you select the Server installation type during the installation process. In case you need to install or reinstall it, just add the Windows File Server package located in the Servers category using the Package Manager tool.
Setup and Configure Winbind

1. Click System, select Administration and click Authentication. This will launch the Authentication Configuration window.
2. Check the Enable Winbind Support and click Configure Winbind. This will launch the Winbind Settings window.

If you would like to allow your Active Directory users to login to your Linux system, change Template Shell to /bin/bash.
To ensure the success of the Active Directory integration, make sure that your Active Directory DNS is working, you are using the Active Directory DNS, you can ping the domain controllers and that the difference between the domain controllers’ clock and the mail server’s clock is not more than five minutes.

4. Click Join Winbind Domain. You will be asked to save your changes, click Save. In the Joining Winbind Domain window, fill in the Domain Administrator and Password. Click Ok when you are done. Click Ok again to close the Winbind Settings window.
6. Click the Options tab and check the Local authorization is sufficient for local users. Click Ok when you are done.
7. Open the file /etc/samba/smb.conf for editing and change the key values below.winbind use default domain = yes winbind enum users = yes winbind enum groups = yes obey pam restrictions = yes

8. Create the folder that will contain the home directory of the Active Directory users. From the terminal window, type in the commands below.mkdir /home/DOMAIN
session required pam_oddjob_mkhomedir.so skel=/etc/skel/ umask=0022

10. Restart the winbind service and start the oddjobd service. Learn how to start and restart services here.Test the Active Directory Integration

3. Finally, type in getent passwd. You should see the Linux system accounts along with the Active Directory user accounts.
If it doesn’t work, visit the Active Directory Troubleshooting page.
***
Posted on 4/25/2007 and last updated on 9/23/2008
Filed under Active Directory , CentOS 5 , Red Hat Enterprise Linux 5 , Samba
Share This




February 15th, 2008 at 10:54 am
In a world of dodgy tutorials, especially dodgy linux tutorials,this was brilliant.
Thank you very much
April 28th, 2008 at 10:40 pm
Hi,
May I know the version of samba that was used with this setup? I’m using the latest upgrade from CentOS repos and it doesn’t work. I’m theorizing that it’s a samba version problem since I’ve seen in other forums that some versions work, others just don’t specially the one that came with CentOS 5.1
April 29th, 2008 at 12:37 am
I got this working in CentOS 5.1
wbinfo -V tells me its version is 3.0.25b-0.el5.4
April 29th, 2008 at 11:01 am
Thanks. We have the same version. It worked! I don’t know, maybe may previous setup was just so messed up I guess.
May 5th, 2008 at 10:52 pm
Hi,
In my setup, this line:
winbind use default domain = yes
winbind enum users = yes
obey pam restrictions = yes
should be:
winbind use default domain = true
winbind enum users = true
obey pam restrictions = true
Does this matter in a big way?
May 5th, 2008 at 11:32 pm
No, they are both the same. According to man smb.conf
The values following the equals sign in parameters are all either a string (no quotes needed) or a boolean, which may be given as yes/no, 0/1 or true/false. Case is not significant in boolean values, but is preserved in string values. Some items such as create modes are numeric.
August 8th, 2008 at 11:34 am
Hi….It worked as in we can login using the domain accnt but there are no policies being implemented by AD…Is there a way to give root rights to the domain accnt???
thanks
August 8th, 2008 at 2:24 pm
Sorry, that’s not possible. Check out Centrify DirectControl at http://www.centrify.com/directcontrol/grouppolicy.asp it might help.
September 15th, 2008 at 9:38 pm
I was able to go through all your steps but I am not able to do anything with the centos box.
I can verify, its integrated with active directory, I can verify that the passwd file was populated with all the accounts but I am not able to do log in with my active directory id.
tail end of /var/log/secure
Sep 15 16:32:11 aries gdm[5342]: pam_succeed_if(gdm:auth): error retrieving information about user amendez
Sep 15 16:32:20 aries gdm[5342]: pam_unix(gdm:auth): check pass; user unknown
Sep 15 16:32:20 aries gdm[5342]: pam_unix(gdm:auth): authentication failure; logname= uid=0 euid=0 tty=:0 ruser= rhost=
September 23rd, 2008 at 1:37 pm
Hi Alex,
If you would like to allow your Active Directory users to login to your Linux system, set Template Shell to /bin/bash. Please read my guide again, I’ve updated the home directory creation section to make it more secure.
November 7th, 2008 at 8:44 pm
Would it be possible to only allow certain users to login? kind of editing some passwd file to set /bin/bash to certain users and /sbin/nologin to the rest and give sudo permissions to those allowed to access?