Slashdot Mirror


pam_ldap/pam_krb5 Authentication Against Active Directory?

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."

25 of 90 comments (clear)

  1. Re:How about the "third solution..." by Anonymous Coward · · Score: 3

    NDS is absolutely the way to go. We currently use NDS on all of our servers: NetWare, NT, 2000, and Unix. Single point of management, fully LDAP compliant (unlike Minion of Satan's), fully leveragable. How else could only three guys run a 10 server, 3000+ user network?

  2. Solutions by Anonymous Coward · · Score: 5

    Hi,

    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

  3. Been there... by Russ+Steffen · · 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.

    1. Re:Been there... by Eimi+Metamorphoumai · · Score: 2

      LDIFDE it is. Don't know anything about CSVDE, but it might work too.

      --

      Visit me on #weirdness on the Galaxynet.

  4. Ganymede by jonabbey · · 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 passwd validation suite.


    - jon
    1. Re:Ganymede by Cato · · Score: 3

      Also, have a look at the presentation at http://kodama.open-it.org/roadmap/index.html - this outlines how the OpenIT group is working on projects to integrate Ganymede with LDAP, both as a frontend protocol and backend storage system (Ganymede currently stores its data in memory). The main OpenIT site is at http://www.open-it.org/.

      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/po ster2.html (which has integrated NT's login process with the Unix/Linux PAM framework) and http://www.smartcard.ust.hk/tutorials/smartlogon2. htm (good set of links on GINA, the NT login DLL that can integrate with third party authentication mechanisms).

  5. And I'd like to know exactly the opposite by ehintz · · Score: 2

    Anyone seen a good resource/howto for authenticating 2k boxes against OpenLDAP? Seems that iPlanet has this going somehow with their product. There's no way in hell we're iplementing AD at my site. As it stands, I've yet to find any decent documentation for how to setup a schema that MS will be happy with, and more importantly how to tell 2k to consult same. FWIW, Apple's done a great job of this with OS X-admin users have to be in the NetInfo db, but mere mortals can be looked up from any LDAP server with noting more than a check box in System Prefs. Nice. Somehow, I have a feeling this is one thing Redmond *isn't* going to steal...

    Regards,

    --
    ehintz
    1. Re:And I'd like to know exactly the opposite by stab · · Score: 5

      Well, you could replace the 2k kerberos auth with MIT Kerberos ...

      http://microsoft.com/technet/win2000/rsvpker.asp

      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/plan ning/security/kerbsteps.asp

  6. Utter Bullshit. by Lt_Kernal · · Score: 3

    Okay. Enough of this shit. FUD killing time.

    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 /etc/passwd) in two formats: the encrypted NTLM passwords, and the LAN Manager hashes. Since the LAN Manager hashes = NT passwords, that's how L0phtcrack gets your pwd's. But, NT has to be SHUT DOWN (when installed on an NTFS part) to get the SAM file to feed it into L0phtcrack. That's where physical security comes in. And, since NT can't protect the passwords when it's shut down, since SP3 there's a utility called SYSKEY which encrypts the SAM when NT is shut down. L0phtCrack can't touch the hashes then. BTW, SYSKEY is not on by default on NT. It is on Win2k boxes with SAM's (Pro and non-DC member servers). Go figure.

    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

    --
    My posts don't reflect the opinion of my employer, and my employer's opinion doesn't influence the content of my posts.
  7. Very possible by Eimi+Metamorphoumai · · Score: 4

    We did that where I work, under Solaris, last summer. What we did is use a perl script I wrote to create a passwd file out of Active Directory (with all the passwords set to NP), then did the authentication using pam_krb5. Set Kerberos up like normal, it it pretty much all falls into place. The only hard parts are programs that don't play nice with pam. I think I can find the Perl script if you'd like it. Email me at lopresto@writeme.com. Good luck!

    --

    Visit me on #weirdness on the Galaxynet.

  8. Re:Sorry, not possible. by ajs · · Score: 2

    I dont want it being posted on the front page of slashdot and having my bandwidth sucked up by casual browsers.

    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....

    --
    Aaron Sherman (ajs@ajs.com)

  9. Re:Resist your users! by gumbo · · Score: 5
    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.

    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

  10. How about the "third solution..." by weakethics · · Score: 2

    Novell's NDS (I refuse to call it e-directory) can interoperate with Win2K and Linux. If you believe their marketing... Anyone tried this? We are thinking about it, but who wants to blaze the trail?

    --
    "I like to play with things a while... before annihilation!" Ming the Merciless
    1. Re:How about the "third solution..." by Xross_Ied · · Score: 4

      I have not looked into Novell stuff for about 6months, but I think you are mistaken..

      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.

      --
      This sig space tolet, reasonable rate.
    2. Re:How about the "third solution..." by apachetoolbox · · Score: 4

      Novell has already made a pam modules for NDS. Just install NDS for linux/solaris on the server and copy the PAM module over. Problem solved. You can also use DirXML to sync an AD "tree" with and NDS tree, so in turn you can login to the tree and have the user object on the AD tree.

      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!

    3. Re:How about the "third solution..." by BawbBitchen · · Score: 2

      He is right. If you have a mixed network and want single user/shares management then NDS is the way to go. I love open source but that does not mean that there is not a good paid for choice too. Novell is good software. And as far as file/print sharing they are still the fastest bang for the hardware out there...

  11. Password authentication should be simple, but... by Trepalium · · Score: 4
    The major problem you'll face isn't authentication (which pam_krb can handle), it's the fact that the stock Microsoft Active Directory LDAP directory doesn't have the needed schema to support UNIX clients without the Services for Unix 2.0 package (in which case, you could just use NIS). To complete the package, you need to have both nss_ldap and pam_ldap, however the format of Active Directory doesn't match the format that nss_ldap expects.

    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.

    --
    I used up all my sick days, so I'm calling in dead.
  12. Maybe try a UNIX KDC? by oddityfds · · Score: 2
    You can always try setting up a UNIX-based KDC, running Heimdal krb5 implementation. (Don't use that one from MIT... ;-) Make sure to only allow console login on that machine, and turn off all services you don't need. It will be the only computer where all the passwords are stored, so if it gets cracked, you're in big trouble. I don't know about you, but I'd rather trust my password database to a properly managed Solaris machine than a W2k machine.

    Now, having UNIX clients authenticate to that server is really straight-forward. Just install Heimdal and kth-krb 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.

  13. Our Solution... by StudentAction.CA · · Score: 2

    Were I work we were looking for a way to manage our hosting customers passwords between linux and unix so updating passwords / accounts would be easier.

    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

    --
    Driven by 100% sarcasm - fueled by the need to be heard.
  14. Comment removed by account_deleted · · Score: 2

    Comment removed based on user account deletion

  15. Comment removed by account_deleted · · Score: 4

    Comment removed based on user account deletion

  16. Some insight - maybe helpful, maybe not... by hillct · · Score: 2

    I asked abot this type of cross-OS authentication integration via Kerberos back at a Win2K launch event after reading about their highly touted Kerberos support. After chewing up and spitting out several Microsoft PR drones, I located a guy who appeared more knowlegable.

    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

    --

    --Got Lists? | Top 95 Star Wars Line
  17. Resist your users! by brash · · Score: 3
    OS flame wars aside, unifying your logins is just a bad idea, from a security perspective. And if you're not concerned about security, then you may as well do away with passwords on your network entirely. You want to force them to use different passwords, and you want to force them to chose good passwords using some sort of password filtering program/library like cracklib, or if you must use NT, passfilt.dll (available in SP2 and later).

    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!

  18. Re:Grow Up by DarkAurora · · Score: 2

    I stand corrected... hey, I was reading it from M$ exploder... :)

  19. Use NIS with Win2k Unix Services by jdh33 · · Score: 2

    I tried forever with kerberos and ldap and it was getting me nowhere. The big problem in getting password unification is Windows have it's one-way password hash and unix has a different one-way password hash. The goal is to generate both hash's at the time the user changes his password. There are a number of solutions but here is the easiest I've found. You say you don't want to use SFU 2.0 but I think you're missing out. SFU NIS adds a the unix crypt password hash for the user into the Active Directory. The crypt has gets updated with the Windows hash every time the user changes his password. And with the NIS server running on windows we have and easy way to retrieve the user list and crypt passwords. We tried using SFU NIS services as the master YP server but that was a mess. Here is what I've do: Setup SFU NIS on your domain controllers and use a bogus YP Domain. Then setup a real UNIX YP master with the real YP domain that all the unix machines will use. Set the Unix YP master to also bind to the bogus SFU NIS domain. then write a script that will 'ypcat -d bogus-domain passwd' and look for changes. When the script sees changes it should add them to the real domain's master yp files and do a make in /var/yp. put that script in cron to run every five minutes. Now the windows domain becomes the master auth info repository but you can unmarry yourself from windows at any time. When you add a user to the windows domain the script will see the change in the bogus_domain's yp map and it will just add the line to you master yp's passwd file. When a user changes their windows password the unix crypt password shows up in the bogus domain and the script just replaces the old line for that user with the new one in the master yp map. All user addition and password changes must be done from the windows side but you only have to do it once in one place. Granted SFU NIS makes you enter in additional information like UID, GID etc... and groups are a bit tricky. But don't you want that? Having Windows make up necessary Unix attributes is a recipie for disaster. This works well and since you are filtering all the entries through your update script you get much more fine grain control of the unix side. My goals were to have a single place for account creation and modification and make it so that users only have to change there password in one place. This does that. It's not pretty but it works. If anyone is interested I can email them the scripts I've writted to generate and update a master yp maps from the windows NIS maps.