r/sysadmin • u/markmm Systems Engineer, VCP5 • Oct 20 '12
Linux AD login authentication - Do you do it and how?
Is there an easy way to have your Linux clients use AD for user login authentication? I have a lot of CentOS servers and would like to have AD authentication so my regular administrators can just use their AD accounts to login without having to keep a separate account on each Linux server, also this will help with the password policies we have in place. I would also like something than can send authentication events to our Splunk indexer like the Windows logon success and failure, 4624 and 4625 events.
I know this can be done but I am looking for something simple to quickly setup on a lot of servers, like a simple rpm you install then a single config file you can fill in with your AD information, restart the service and you are up and running.
Do you authenticate your Linux users with AD and how?
28
u/[deleted] Oct 20 '12
I tried this- https://help.ubuntu.com/10.04/serverguide/likewise-open.html for home lab. Worked like a charm.
17
u/[deleted] Oct 20 '12
I have AD authentication working beautifully with CentOS using winbind and SAMBA, doing exactly what you want. Admins log in with domain credentials, and through AD group memberships get access to use sudo. It's actually not that difficult. Here's one walkthrough, there are tons of other ones:
http://wiki.centos.org/TipsAndTricks/WinbindADS
Once you have winbind working and seeing your AD users and groups, you can use an AD group just like a local UNIX group, including defining file permissions and within config files like sudoers. The only caveat is some programs don't like spaces in the group names in their config files. So you might need to rename and create some new groups in AD.
8
u/[deleted] Oct 20 '12
Yes. Use samba\winbind. Or use Kerberos\LDAP through OpenLDAP and mapped to Active Directory and a Kerberos server or straight to Active Directory. Use FreIPA and bridge to Active Directory. You have lots of options. Purchase Quest Authentication Services (now owned by Dell) or Centrify. Use or purchase Likewise Open.
You will find that, based n what solution you go with, that maintaining anything close to a unified password policy will require more then simply ensuring that Linux users can authenticate against Windows. You are already in the trap of "make Linux work like Windows" versus "make Linux work with Windows". You want the latter but I understand that 9 out of 10 times management wants the former.
I you want and\or need accurate and clear "this user logged in to this server at X" (4624) or "this user failed to authenticate against from this server X at this time" (4625); then you are going to want to use a solution that leverages Kerberos and a solution that uses LDAP 2307 schema attributes to define user obejcts. things like uid, uidNumber, gid, unixHomeDirectory, etc. Windows Active Directory 2008 R2 supports these natively. Your solution should leverage them or you're going to have some difficulty in mapping uid to actually user...I'm looking at you samba.
Like that saying goes; fast, good, cheap...pick two. Some solutions are easier than others; that's for sure. You need to figure out what it is you actually want to or need to accomplish.
Here's my solution. A lot of people don't care for it because right now it's manual, requires that you tinker with your user and group objects in Active Directory or know how to use ldifs and\or csvde effectively to make bulk-user changes, it has a lot of steps and steps are hard, it doesn't use samba\windbind (because my solution specifically required getting rid of a poorly implemented samba\winbind solution), and, last but not least, it has it's own share of errors and less then clear objectives. But the biggest reason that people don't like it is because it has too many steps. Steps are hard, wrong is better :).
Configuring Red Hat Enterprise Linux (RHEL) 5 To Authenticate Against LDAP (Microsoft Windows Active Directory 2008 R2) Using Kerberos 5
I'm actually in the process of scripting this solution but, right now, it only supports RHEL 5 and RHEL 5 clones. My scripted version also supports autofs maps from LDAP configuration as well now. Requirements. They matter.
My point is not that you use my solution, rather, that you figure out what your requirements really are and find or create a solution that achieves them. I would really suck to buy a solution and find out it didn't do what you needed or, worse, that you could have accomplished the same thing for no cost other than your time.
There are lots of solutions out there. Look at them all, consider your requirements, and put something together that does what you need it to do.
5
u/[deleted] Oct 20 '12
http://www.quest.com/authentication-services/ I'm sure its really expensive but we have a ton of servers, there is some setup on AD side as well but i don't handle that part.
4
u/TwistedStack Oct 20 '12
This only works on CentOS/RHEL and derivatives:
/usr/sbin/authconfig --enablekrb5kdcdns --enablekrb5realmdns --smbworkgroup="EXAMPLE" --enablewinbind --enablewinbindauth --smbsecurity=ads --smbrealm="EXAMPLE.COM" --smbidmapuid="10000-20000" --smbidmapgid="10000-20000" --winbindtemplateshell="/bin/bash" --enablewinbindusedefaultdomain --enablewinbindoffline --winbindjoin="Administrator" --enablecache --enablemkhomedir --update
3
u/randomfrequency Head -> Desk Oct 20 '12
Check out the FreeIPA project.
There's an authentication component to AD that involves blasting domain passwords around, it won't be 'fast'.
3
u/Cidan Oct 20 '12
Edit /etc/sssd/sssd.conf so it looks something like this:
Then restart sssd:
And you're done. Works on both RHEL5 and 6 (and all clones, CentOS, SL, etc).
2
u/problemforme Oct 20 '12
We do it. I'm not sure how; I'll have to check with our Linux admin and get back you.
2
u/[deleted] Oct 20 '12
http://wiki.centos.org/TipsAndTricks/WinbindADS
2
u/zuzuzzzip Oct 20 '12
First I used Likewise Open. But I stopped using it once some company acquired it. I started getting loads of junk mails because of this. Also it did not work perfectly and was third party software.
I now use Winbind, which relies on Samba and it is much easier to setup. I have a CLI one-liner to join a linux box to Active Directory. In CentOS and Red Hat you can do this with the authconfig command.
btw: I use CentOS (some RHEL documentation here)
2
u/jolly_erich Oct 20 '12
Just set this up following this guide: http://lanestechblog.blogspot.com/2010/11/ad-authentication-with-rhel-6.html
2
u/musicalvegan0 Oct 20 '12
I use SSSD. It's worked great so far in my Windows+CentOS+Ubuntu environment.
SSSD takes everything into consideration when allowing you to authenticate with AD.
You may just be asking for login authentication, but with that comes a lot of other behind the curtains things a user doesn't normally think of. For example, UID to AD ID sharing/independence. Home directory and shell configuration. Group membership. SSSD allows you to configure all of that on the Linux side, but also is compatible with Windows' SFU package if you choose a more AD-inclusive approach.
SSSD is the easiest all-in-one solution. You can do other things though, like Samba+Windbind and LDAP/S+KRB5. These other solutions are proven in production but offer tougher configuration.
Good luck!
1
u/UnoTaco Linux, Windows, Infrastructure Engineer Oct 20 '12
Not exactly super easy but most can be set up with system-config-auth. Use winbind + krb5. Use AD idmap back end, install Unix identity services on your DCs. It's as simple as 'net ad join -U username' once your configs are setup.
1
u/[deleted] Oct 20 '12
We use vintela for Solaris, and Linux AD logins - http://www.quest.com/authentication-services/
It is, I'm told, not cheap. But it is one of those things that just works well.
1
u/tehphr4nk Nix Admin, VCP5, RHCSA Oct 20 '12
We have a ldap server that points to our domain controller then Configure our servers for LDAP authentication.
1
u/alsimone Oct 20 '12
Kerberos is ready to set up. Only one config file and it's not complicated. Don't even need to restart anything.
I'd look at LDAP for authorization. Also check out pam_mkhomedir.so.
1
u/midgetparty Oct 20 '12
http://prowiki.isc.upenn.edu/wiki/Linux_Kerberos_configuration
1
u/Tr0l Security Admin Oct 20 '12
I am interested in the same thing but, I need AD usernames to be mapped to different Linux usernames. One of our applications is in COBOL and the permissions for the application are directly related to the first letter in a username (currently A, B, or C). Is there a way to have the Linux server authenticate through AD but assign a specific Linux username to each AD account?
1
u/macjunkie SRE Oct 20 '12
We used to use Pam SMb, now we just shove passwords to our Linux hosts from our Idm system when a user changes their password or is provisioned
1
u/shinta148 Sr. Engineer, IT Security Oct 20 '12
Likewise Open rocks. We use it for our Linux Environment (mix of CentOS and Ubuntu workstations) and we have the full fledged power broker enterprise for our Macs.
Love it.
1
u/sakodak Oct 20 '12
Others have mentioned, but look into FreeIPA. It's incredibly easy to set up and it's Linux/Unix native, allowing you to do some things that a simple auth against AD can't:
As others have said, with version 3 (which is out now) you can set up a domain trust between your AD and IPA kerb realms, so you get SSO across the board, with the benefits that IPA brings to the table.
1
u/[deleted] Oct 20 '12
Joining domains with samba just for logins? Christ, what overkill! Dude, ignore all that nonsense you're told about that. And anything about likewise etc. Install Unix extensions on AD for one thing, then configure ldap.cibf or nskcd.conf for user info lookups. Then use either simple kerberos od the same ldap configuration to authenticate. I suggest ldap and nothing else, but standalone kerberos is pretty easy. You shouldn't need to install ANYTHING extra at all.
DON'T USE SAMBA TO JOIN THE DOMAIN. OVERKILL!
I would also recommend using puppet to deploy these configuration as it's an excellent tool in general.
1
u/BitingChaos Oct 20 '12
Our server: Windows Server 2003 R2 (x64)
Our clients:
It's pretty simple. We just use LDAP + Kerberos. Kerberos is dead simple to set up ("it just works"). I had to use slightly different LDAP configs on each platform (FreeBSD & Ubuntu use a similar config, CentOS uses a slightly different "SSS" method). You can then edit the appropriate pam.d config to allow local login.
Users can SSH in or use NFS shares. Windows stores their UID, GID, Shell, Home, etc. We can manage permissions directly on the clients. Users can change their password direct from the clients as well. All users are seen as local accounts.
For CIFS, I use Winbind+Kerberos. Users get their correct UID/GID vis rfc2307 and so the CIFS permissions match the NFS permissions perfectly (we do not use Winbind for local login, only SMB/CIFS access).
1
u/[deleted] Oct 20 '12
Linux to AD? I've seen Windows to LDAP done via PGina before, but not the other way around.
1
u/mingaminga Oct 21 '12
As a pentester, I applaud this idea. I love knowing that your Linux boxes will be immediately 0wnable.
0
u/[deleted] Oct 20 '12
[deleted] — view deleted comment