Slashdot Log In
pam_ldap/pam_krb5 Authentication Against Active Directory?
Posted by
Cliff
on Sat Jun 02, 2001 10:48 PM
from the interoperability-as-the-goal dept.
from the interoperability-as-the-goal dept.
Very Jerry asks: "Here's my problem. I'm currently in the middle of unifying all of our logins here at my place of work because of all the usual reasons (users forget passwords all too often, leaving them more resistant to setting up more complex passwords). Now we have an Active Directory domain setup here, and I was hoping to have all the users authenticate to that. SFU 2.0 is out of the question because it still leaves you to define extra attributes on the user in Active Directory Users and Domains. After a bit of searching, I've found out that pam_krb5 and pam_ldap have been used with success for authentication, but wherever I turn, there are no specific details. I'm currently 2 weeks deep in to this with no progress and a looming deadline. If anyone could point me to some good, specific instructions (specific to Active Directory, not just OpenLDAP) or help me out with a couple tips, it would be much appreciated."
This discussion has been archived.
No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Full
Abbreviated
Hidden
Loading... please wait.
Re:Solutions (Score:1)
Enjoy
Re:Been there... (Score:1)
B. Johannessen (to lazy to log in)
Re:How about the "third solution..." (Score:3)
Solutions (Score:5)
We have had similar issues regarding Microsoft's Active Directory product at Amaa Fui. We were switching from a Unix based kerberos system to one that used Microsoft's.
Here are some solutions to the same problems you had. Firstly, you need to patch your w2k boxes to the latest pack. Then install the beta k5 updates from Microsoft beta w2k site. These updates remove the slight changes Microsoft made to kerberos, and thus makes it compatible with your other systems.
Once those are patched in, you need to install Heesi optimizer (This can be found on any download site), I recommend this, cause this would go through your AD configuration and kerberos setup and tell you exectly where your security is weak and so on.
Once everthing is in place, you can move to more secure passwords and corportation wide access to single passwords. But let me warn you, you still need different passwords on resources that are of a criticial nature.
Also ensure everthing is behind firewalls and if your using VPN install the latest patches from Microsoft site, We run OpenBSD and Ipsec, they work very well with the current configuration.
Our systems include, Windows 2k/nt, Linux i386/alpha/ppc, Mac OS 9/X, HP/UX, IBM AIX, Solaris and an old VAX system. All of them are maintained by the w2k based kereberos authentication systme and LDAP for directory stuff.
Everthing works well and I'm very satisfied, only concern we have is that Microsoft's version of kerberos is very slow to authenticate our user. This creates some problems, specially since some of our internal services have authentication decay in it, to solve this problem we just moved to better hardware, but this is something Microsoft has to solve on their own.
Good luck with your setup and hope this helps, if not you can send me an e-mail to, fadaboi@NOSPAM.riyaasath.com
Fadaboi Kesbe
Been there... (Score:5)
Done at least half of that...
Authenticating users against AD with pam_krb5 works fine. Just list the DNS names of your Win2k domain controllers in the config file just as if they were normal Kerberos servers, and use the AD domain as the Kerberos realm.
When I did this, I still had local passwd and group files. But it should be possible to move that stuff into AD. You would have to modify the AD schema to include that info in the directory (that's not a task for the faint of heart). Once you do that, though, it's pretty easy to query AD from Linux.
Re:Solutions (Score:1)
Use aux classes and dump relevant data to NIS (Score:1)
I'm in the process of building a system that integrates Windows and Unix logon data. My environment currently includes Debian GNU/Linux, Microsoft Windows, NetBSD, Silicon Graphics IRIX, and Sun Solaris, and I hope to bring Compaq OpenVMS and Apple MacOS (pre-OSX) clients into the mix within the next six to twelve months. What makes a difficult project even more challenging is that I'm attempting to integrate file sharing as well as domain logon. The environment I'm building is in it's third generation.
Getting Kerberos 5 clients to authenticate against AD is pretty easy and (for MIT Kerberos 5 and SEAM clients) well documented. See Windows 2000 Kerberos Interoperability [microsoft.com], Step-by-Step Guide to MS Kerberos 5 Interoperability [microsoft.com], and SEAM 1.0 Interoperability Documentation [connectathon.org]. You should be able to adapt the SEAM instructions to pam_krb5 on Linux, or you could use login.krb5 (which comes with MIT Kerberos 5). Note that Heimdal clients don't support DES-CBC-MD5.
The biggest problem with Active Directory has nothing to do with Kerberos, and everything to do with getting directory information out to clients in the realm. For example, NetBSD doesn't currently use the PAM mechanism, and Solaris has a difficult time understanding Microsoft's somewhat peculiar schema. To this end, I've decided to use NIS to publish certain directory data to my Unix clients (user name, UID, GID, GECOS, home, and shell; group name, GID, and members), and revisit client directory access issues as the technology matures. And since I can't get SFU to install on my DC (the DC's DNS domain name and the AD domain name are different, and this causes problems for SFU's installer), I've resorted to creating the necessary auxiliary classes by hand and using some glue code to dump user and group information from LDAP into the relevant NIS databases.
Rev. Dr. Xenophon Fenderson, the Carbon(d)ated, KSC, DEATH, SubGenius, mhm21x16
Microsoft had to hack around Kerberos (Score:1)
That's the other "his" point. Both Kerberos and NTLM require unique account names within an administrative domain and can't (easily) use DNs in the place of the User Principal Name or the SAM Account Name.
And yes, the old (NT4) domain system was basically a flat file (the SAM database), but this isn't the reason behind the requirement for unique UPNs in Active Directory. Kerberos too uses a flat database, and there has traditionally been no way to partition a realm (that is to say, the entire realm is propagated among masters and slaves in Kerberos). The replication and partitioning limitations in Active Directory are derived from AD's roots in Kerberos, not NT4.
Rev. Dr. Xenophon Fenderson, the Carbon(d)ated, KSC, DEATH, SubGenius, mhm21x16
Re:Password server (Score:1)
Ganymede (Score:5)
Where I work, we master all of our accounts for UNIX and NT, along with all of our email routing, our NFS volume definitions, our automounter configuration, and our DNS, in Ganymede.
We synchronize passwords from Ganymede into NIS, Samba, and our Windows NT PDC. We also configure tacacs and radius, and LDAP from the same master database. Ganymede provides a high quality GUI interface, and allows you to designate privileges over the directory database to as many classes of administrators as you like. Several people can be simultaneously browsing and making changes to the database, and when transactions are committed, a background thread updates all of the network services. Ganymede is the closest thing that the open source community has to NDS or Active Directory, in terms of being a complete management solution, even though it is not based on LDAP and it does not scale anywhere near as well as an Active Directory or NDS. If you are looking to manage a single location, however, Ganymede will do the job right.
Take a look at the web site in my .signature, below. Ganymede 1.0 is due out within the next week, along with a userKit that supports password synchronization for UNIX, Samba, and Windows NT, with password quality checking handled by Clyde
Hoover's excellent nPasswd [utexas.edu]
passwd validation suite.
- jon
Re:Dear Slashdot... (Score:1)
It's a hope that's out there, but I feel I'm not the only one... just as the original ask slashdotter isn't the only one with this problem..
Re:Ganymede (Score:3)
It may also be worth investigating how you can get Win2K clients to authenticate against a Unix/LDAP server - in the NT world, some links to follow are http://www.citi.umich.edu/projects/singlesignon/p
Re:Resist your users! (Score:1)
Basically what happens is that if you set up a box to broadcast as another box windows systems will pass their encrypted login information. The malicious box then does an authorization request against the domain and can act as that user.
Please not that if your system admin on a windows box uses a browser... isn't integrated browsers nice... you can point it at the malicious system and automatically have it try to access the system, thus not even requiring you to broadcast the malicious box as a resource on the network.
Cute little toy to use with web bugs and another reason to block all port 137 and 139 traffic to the internet for those of you with internet connections.
I know that Sir Distic (sp? again) released his code into the wild and while I haven't had a chance to look through the code, I have seen the program in action and can verify it works even in a "hardened" Windows environment.
The problem isn't a bug in the system, but a design flaw within SMB, so the question is how secure do you want to be?
Lando
Re:Maybe try a UNIX KDC? (Score:1)
It is possible to do cross-realm authentication between an MS realm and a non-MS realm, but then you need to perform an account mapping so that the MS realm issues the proper service tickets at the end of the referral chain. Happy happy, joy joy.
And I'd like to know exactly the opposite (Score:2)
Regards,
Re:Utter Bullshit. (Score:1)
And when SYSKEY is enabled, it's STILL encrypted...even on the ERD and the repair directory. Plus, you still have to have PHYSICAL access to an ERD or the machine to do it.
I didn't SAY the SAM wasn't easy to get. But I said you gotta have PHYSICAL access to do it. I don't know about YOU, but that's why I lock my servers (and the ERD in a safe therein) in a room.
Listen next time.
-Kevin, MCSE/MCT
Re:Utter Bullshit. (Score:1)
You gotta be an Administrator to run pwdump2.
Normal users don't have that right. And since I'd be an Admin...I could just change the password myself in User Manager.
Cheers.
-Kevin, MCSE+I/MCT
Utter Bullshit. (Score:3)
Let's get this straight. MS Does NOT pass clear text passwords over the network. There are basically three types of authentication on MS networks:
1. LAN Manager hashes: This is where the password is simply 'hashed' (weak obfuscation) and not encrypted. Used by LAN Manager, Win 3.x, DOS, and 9x clients authenticating to NT and Win2k DC's. Also used by NT in a non-trust same username/password on both sides situation. Easily snooped, and when fed into L0phtcrack, can be broken. ie: if two users' passwords were "luser", they'd have the same hash representing them.
2. NTLM (NT LAN Manager): Used by WinNT against all DC's and Win2k boxes authenticating against NT DC's. Totally encrypted. The client does a secure, encrypted RPC "trust" with the domain controller, and then passes the name/password combo to the DC, which then passes back an access token. CANNOT BE SNOOPED OR BROKEN. Two versions: NTLM v1 and NTLM v2.
3. Kerberos: Used by Win2k clients against Win2k DC's. Even more secure ticket-passing scheme. 'Nuff said.
Now. You see what I said that NT passwords can't be snooped or broken? I'm serious. It's impossible. LAN Manager hashes, however...Easy. So, you asked how in the hell does L0phtcrack break NT passwords?
Here's the funny part: it doesn't.
On every NT box, the passwords are stored in the SAM (equivalent of
On Win2k DC's, everything is stored in the AD database. Try and crack that. I'm sure it'll eventually be done...but it'll take a long while.
So, in short: Don't use downlevel (non NT) clients, turn on SYSKEY, and the LAN Manager hash scourge will all but be eliminated.
However, there is a Directory Services Client for 9x/NT that allows it to use NTLM v2 in a Win2k network. I still wouldn't use 9x.
In other words...don't talk about which you do not know.
Cheers,
-Kevin, MCSE+I/MCT
Re:Been there... (Score:1)
Re:Been there... (Score:1)
Re:Been there... (Score:2)
Very possible (Score:4)
Re:Resist your users! (Score:1)
IIRC if you use NTLMv2 this is not the case.
Avoid supporting downlevel clients if possible (98, etc) and security will also be better.
Check out:c .asp
http://www.microsoft.com/technet/security/
http://www.microsoft.com/technet/security/bestpra
http://www.microsoft.com/security/default.asp
Re:And I'd like to know exactly the opposite (Score:5)
http://microsoft.com/technet/win2000/rsvpker.asp [microsoft.com]
And 2k clients could still authenticate with no problems, but you have a *NIX based KDC, with the obvious advantages that brings.
Microsoft even publishes a step-by-step guide to doing this!
http://www.microsoft.com/windows2000/techinfo/pla
Don't you just love (Score:1)
Like I'd use my
Re:How about the "third solution..." (Score:1)
Somewhat true, yes. All changes are replicated to every DC in the same domain. A much smaller subset (the global catalog) is replicated to DCs outside the domain.
Also know that in AD, when you edit an attribute in an object, the entire object is resent out to all the servers. Not just that attribute for the object.
This is plain FUD. AD does indeed replicate at the attribute level. But don't just take my word for it, as you have obviously done with your misinformation, verify this yourself:
http://www.microsoft.com/WINDOWS2000/techinfo/resk it/samplechapters/dsbh/dsbh_rep_mqeg.asp [microsoft.com]
Re:Two Important issues (Score:1)
Huh? since what version? I'm using LDAP pam w/o
Re:Sorry, not possible. (Score:1)
The key here is "white paper". I saw three posts that summed up what to do in two paragraphs or less. But, our boy here is writing a white paper! Oooh, I get all tingly!
in
Ok, I know they don't teach this in the "Magic of Word Processing" VHS course, but you can click (using the mouse) on the "File" menu, and then select the "Save As" option. This allows you to save your documents in many of the formats that people use to communicate information such as "text" (an advanced format for which many WYSIWYG editors exist).
I'm sorry, I know I'm being sarcastic to a fault here, but such a condescending post that lacks any real information, and whose humor is solely based on stereotype was a little thick for me. I suppose in sinking to that level, yadda yadda, but at least I feel better now.
--
Aaron Sherman (ajs@ajs.com)
Re:Sorry, not possible. (Score:1)
If your white paper requires binaries, I cannot imagine a case where giving a footnote to an FTP server would not be more useful than trying to embed the binary itself.
Ah, now you want to select the "HTML" option when you save. Much more portable, and images are rendered much more cleanly by most browsers.
These are text to begin with. Again, though, I suggest putting these in an appendix of links to a Web or FTP server.
Special case of images, see above
Text. See above
See above
ASCII, was that it? Yeah, I'll jump right on that.
Good. Best papers I've ever read were all text. "Substance before form".
Plus, you dink,
Quite called for. I'll try to rise above my initial comments.
Some, but not even most
--
Aaron Sherman (ajs@ajs.com)
Re:Sorry, not possible. (Score:2)
So, you'd rather that the DOC file be downloaded? Why? It saves no space; in fact compared to your average HTML document + images, DOC files are usually much larger, which means more of your bandwidth.
Alternately, you may not intend to offer this over the Web. Well, then problem solved. If you send someone a zip (tgz, hqx, etc) file with the HTML + images + binary files, you are no worse off than if you sent them a DOC file, except more people can view it.
If you want to read my document, then get a DOC viewer. Elsewise, bugger off.
Then I (a sysadmin, presumably your target audience) choose the latter. I have no time for exploring proprietary data formats in order to get the information I need. I'll wait until someone produces a HOWTO in the standard format [spdae.com]....
--
Aaron Sherman (ajs@ajs.com)
Re:Sorry, not possible. (Score:1)
Re:Resist your users! (Score:1)
Get a clue.....
Dave
the NDSU folks can top AD anyday (Score:1)
Done something similar (Score:1)
Re:Resist your users! (Score:1)
So you can't just log in by typing someone's password after stealing it, by you can write a program that'll send the replayable hash at the right time when asked.
Re:Sorry, not possible. (Score:1)
Re:Resist your users! (Score:5)
I'm certainly not a Microsoft fan, but I have to stop FUD when I see it. The above is false. The SMB side of my network is 95/98/NT/2000, and there are no clear-text SMB passwords floating around. The Win 95/98 machines authenticate against the NT domain, and do it without plain-text passwords. Same thing when the Linux machines need to connect to an SMB share. So, sorry, but that's just not true.
They do pass around password information that L0phtcrack can work with, though, so if the passwords are weak, they'll be easily broken. It's essentially the equivalent of sending out /etc/shadow entries unencrypted on the network.
Gumbo
How about the "third solution..." (Score:2)
Password authentication should be simple, but... (Score:4)
Somewhere on MS's site is some code for adding/deleteing/modifying users from Active Directory along with a script that could cull the users from active directory and allow you to import that into a passwd file (minus the passwords, which would be authenticated via kerberos). This is certainly not for the faint-at-heart, and I looked into it for a while and eventually gave up on that idea because it was simply too complex and too likely to break for no apparent reason.
Maybe try a UNIX KDC? (Score:2)
Now, having UNIX clients authenticate to that server is really straight-forward. Just install Heimdal and kth-krb [pdc.kth.se] and set it up. The passwd file is distributed using a cron job. It works fine, don't worry.
The Windows clients, at least W2k clients, should be able to authenticate to the KDC, and I think you can solve the rest of the centralized account management through AD.
See, all you clients will use KRB5 or at least KRB4 authentication so you should have a potentially secure system. If you need more PAM modules then you can use the ones from MIT kerberos as well, or Naomaru's.
Our Solution... (Score:2)
My solution was Samba-TNG with LDAP, using pam-ldap on linux (with a base DN for each server) and a DN for the NT servers... Samba-TNG becomes the domain controler, and therefore lets users log in against it.....
Just my $0.02
Re:Sorry, not possible. (Score:2)
Super, glad to hear it.
Ok, I know they don't teach this in the "Magic of Word Processing" VHS course, but you can click (using the mouse) on the "File" menu, and then select the "Save As" option.
Thats nifty! Whats the text format that allows you to embed binaries, such as images, configuration scripts, screen captures, packet dumps and the like? ASCII, was that it? Yeah, I'll jump right on that. Plus, you dink,
Asshole-ness aside on both sides for a minute, let me explain a few things.
The three posts that summed things are great. They are summaries. Super. Summaries are great. I like summaries. But I think the gentlemen asking slashdot wanted a bit more, like perhaps, a resource. Actually, let me quote from his question:
If anyone could point me to some good, specific instructions
So, perhaps your magic three posts are specific instructions in all, but I doubt it. No, I extended an offer of specific, detailed, research along with step-by-step instructions on how to make it work in the real world. I guess thats not what slashdot is all about. I guess slashdot is all about terse answers, summaries, and a general lack of depth.
And you know something else, my original post was exactly correct.
I made seven predictions in my original post. They are fullfilled by posts #85 [slashdot.org], #9 [slashdot.org], #33 [slashdot.org], #102 [slashdot.org], and finally #19 [slashdot.org].
So, this is a clear case where the sterotype was completely and utterly correct. Every point was proven, and my prediction was proven correct - even with my post at the top of the page.
but at least I feel better now.
I guess thats enough to make my day all worthwhile.
And to anyone who would like the paper in question, its not done yet, but at 70 something pages, its complete enough to be usuable in the real world. Go ahead, e-mail me, and I'll send along a copy (its big, so hope your e-mail server likes 5 mb attachments).
Sorry, not possible. (Score:4)
First off, this isn't possible. Microsoft doesnt play well with others. Microsoft has engineered 100% of its products to be incompatible with 100% of other products. They stole LDAP from the great and noble linux community and have destroyed on purpose to fuck with us.
Second off, your request implies that you are usign Active Directory. Active Directory is based on Windows 2000. I know what A & B are, but I hope that my guess on A & B implies is wrong. Win2k has 64k bugs, so hopefully you arent using that piece of crap.
Third Off, even if you are using Win2k, I am sure you will be better off just switching to an OSS product, because M$ (like that dollar-thing, I invented that) is the Evil Empire, and plus they make you pay for software.
Fourth Off, Microsoft will just put you on the upgrade treadmill for ever and ever and you will die on it, until you switch to a quality OSS product.
Fifth off, its all your "lusers" faults anyways- just tell them that passwords are important. If they give you trouble just refere to the bastard operator from hell texts for further instructions.
Sixth, M$ isn't 1337, and its insecure as anything. It requires bad things,and it will make your life hell. Hackers will get into your box even if its not plugged into the 'Net. They can do that, really (especially if they use Linux). Also, note that Windows Update will send all your information to MS, and they will invade your box looking for bad licenses and stolen software.
Seventh, and finally, don't do it man. M$ is lame. Linux rocks. I mean, really dude. Seriously. Linux doods rock. Win2k sucks, except if you like BSOD's every two seconds.
Okay, well, that should summarize the rest of the posts on the topic. Ohh, and if you really want, I am half-way through a white-paper on this exact topic and feel free to email me for a copy (in
Re:How about the "third solution..." (Score:4)
e-directory (your name NDS) is NDS that can run on NetwareOS, WinNT/2K and Linux..
a) On WinNT/2K it actually replaces domain/AD as the authenticator.
b) on Linux it replaces the password file by using PAM modules to redirect authentications to NDS
What you are thinking of is DirXML a directory synchronizing daemon that maps parts of AD to NDS and vice-versa. IMO it is the slickest software from Novell since Netware 3.11 came out.
You create the mapping of NDS schema to/from AD and you can tell it what part of (container / organizational unit) your NDS maps to what part of AD. You are still running two directories which are being synchronized at an interval you decide. What makes it kick ass is the schema and attributes synch is all visual, point and click.
Some insight - maybe helpful, maybe not... (Score:2)
While, yes, Microsoft has adopted Kerberos for authentication, No, it was not compatible with any existing Kerb tickets. Aparently, Microsoft, in their infinate wisdom, chose to place Win2K domain authentication data in the comments field of Kerb tickets generated via a Win2K login.
This has the result of making it possible to use tickts generated through Win2K authentication within treditional UNIX Kerb realms, but tickets generated outside Win2K would not work. There would be an easy solution to this problem if Microsoft would release details of the chhanges they made to the Kerb ticket format. As of my inquiry (Feb 2000) Microsoft had not provided details of these changes. This may have changes since then.
--CTH
Resist your users! (Score:3)
The problem with unifying your logins is of course that once an attacker has compromised ANY of your user's passwords, they now not only have access to your network, but they also have authenticated access to ANY resource which that user has access to. From here, it won't be long before they own your network.
Is this what you really want? Again, it isn't, if you care about security.
Now, because I gotta get my shots in, you also should not be doing your authentication on a Windows machine, because Windows-based authentication is inherently brain-dead.
If an attacker manages to get onto your network, they'll probably be able to sniff someone's password within about 5 minutes since Windows will use plain text unless you're in an all-NT/2000 environment. Once they have that, it will take about 2 minutes to get your password database. At this point, they can log off, crack passwords at their lesiure, and within about 4 hrs they'll have over 90% of your passwords using l0phtcrack (which, by the way, will happily sniff passwords off the network for you too).
You should use a solution that allows encrypted authentication, and that pretty much means Unix or a third-party authentication package for Windows. Throw AD away.
Have a nice day!
Re:Grow Up (Score:2)
Re:How about the "third solution..." (Score:4)
I use the term tree with AD loosely; understand it that AD isn't truly a hierarchical system. It's a flat database just like their old Domain system. Don't believe me? Test it, create an OU, and make a user called "bsmith". Now create another OU anywhere else and try and create a user named "bsmith". You can't. Seriously look into Novell's NDS as a directory solution, you can't even partition an AD tree. That means the entire database is transmitted to every server, even if their OU has nothing to do with that system. Partitioning a tree keeps the traffic to a minimum while still replicating to other specific servers for redundancy. Also know that in AD, when you edit an attribute in an object, the entire object is resent out to all the servers. Not just that attribute for the object. AD is still not even remotely close to NDS.
NDS runs on Netware, NT, Win2000, Linux, Solaris.
AD runs on Windows2000, and to really use it all your workstations have to be Windows 2000!
Re:How about the "third solution..." (Score:2)
Use NIS with Win2k Unix Services (Score:2)