LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-02-2005, 09:58 AM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
Question apache / ftp authenticationg against Active Directory


Is there a module for apache that could authenticate users against active directory? Like squid's ntlm_auth. Maybe there's one that used the exit code of one script (I think there's one like that for squid too).

How about a ftp server? Is there one that could authenticate against Actibve Directory?
 
Old 08-02-2005, 10:54 AM   #2
slacky
Member
 
Registered: Feb 2004
Location: USA
Distribution: Debian
Posts: 174

Rep: Reputation: 16
You can authenticate against Active Directory using either LDAP or Kerberos, and there are Apache auth modules for both of them. Don't know about FTP. LDAP is pretty easy to setup, Kerb is complicated & requires configuration on AD & with MS Resourse Kit tools - but with Kerberos you can do automatic logon when user's PC are part of an AD domain. Here's LDAP Apache 2 config:

Code:
<Location /ldap>
    AuthLDAPAuthoritative on
    AuthType Basic
    AuthName "LDAP Test"
    AuthLDAPBindDN cn=username,cn=Users,dc=yourdomain,dc=com
    AuthLDAPBindPassword password
    AuthLDAPURL "ldap://ldap.yourdomain.com:389/cn=Users,dc=yourdomain,dc=com?sAMAccountName?sub?(objectClass=*)"
    require valid-user
</Location>
On my Debian Sarge system - mod-auth-ldap seems to be included with the Apache 2 package & libapache2-mod-auth-kerb is the Kerberos module.

Hope that helps,
Josh
 
Old 08-03-2005, 01:55 PM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
OK.... I think I'm close to getting it.

I'm still trying... but I've made some advances.

Using a LDAP browser (JXplorer), I've been able to connect to the active directory and understand what the mod_auth_ldap will do (sometime).

As much as I understand, I have to give the ldap auth module a DN with a CN to bind to the LDAP server?

Cause the CN of my user (the one I'm using for testing) has a space (it's my name plus my lastname).

Suppose I'm john hancock:

AuthLDAPBindDN CN=John Hancock,OU=Software,OU=IT,DC=domain1,DC=domain2

If I set it like that, apache complains because of the space.

Can I use the sAMAccountName instead of the CN?
 
Old 08-03-2005, 01:57 PM   #4
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
also: How can I log the ldap activity?
 
Old 08-03-2005, 01:58 PM   #5
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
And by the way.... I'm not in Users. Maybe that's the problem. Does it have to be someone from Users?
 
Old 08-03-2005, 02:16 PM   #6
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
GOT IT!

the AuthLDAPBindDN is just my username.... with the GROUP:

AuthLDAPBindDN GROUP\username
 
Old 01-04-2006, 04:00 PM   #7
TotalDefiance
Member
 
Registered: Jan 2004
Distribution: Slackware, RH, WBEL
Posts: 65

Rep: Reputation: 15
Same Issue

I'm running into th same issue using mod_authz_ldap-0.26-2.

Here is my config in .htaccess file:


AuthzLDAPMethod ldapmapped
AuthName "Test LDAP"
AuthType Basic
AuthzLDAPServer hostname.domain.net
AuthzLDAPBindDN "CN=testbindacct,OU=ADManagers,DC=ads,DC=domain,DC=net"
AuthzLDAPBindPassword "Password123"
AuthzLDAPUserBase "OU=ADManagers,DC=ads,DC=domain,DC=net"
# AuthzLDAPUserKey CN
AuthzLDAPUserKey sAMAccountName
AuthzLDAPUserScope subtree
require valid-user


This configuration gives me the authentication dialogue, however I dont think that LDAP is even contacting the Active Directory Server.

I have run Ethereal while doing multiple authentication requests, and I see my http transcations, but there is NO outbound LDAP communcation to my LDAP server.

I am using an ADManager (active directory manager) account to bind with, and am also testing authentication of ADManagers as well.

Does anyone have any ideas? Pointers? Is there a logfile for mod_authz_ldap?
 
Old 01-05-2006, 09:21 AM   #8
TotalDefiance
Member
 
Registered: Jan 2004
Distribution: Slackware, RH, WBEL
Posts: 65

Rep: Reputation: 15
Some progress...

Code:
<Location /ldap>
    AuthLDAPAuthoritative on
    AuthType Basic
    AuthName "LDAP Test"
    AuthLDAPBindDN cn=username,cn=Users,dc=yourdomain,dc=com
    AuthLDAPBindPassword password
    AuthLDAPURL "ldap://ldap.yourdomain.com:389/cn=Users,dc=yourdomain,dc=com?sAMAccountName?sub?(objectClass=*)"
    require valid-user
</Location>
by using slacky's above method (modified to my ldap URL), I am now able to see traffic to our LDAP/ActiveDirectory server. Authentication is still failing...I'm assuming it's not binding the username to the right property (ie sAMAccountName) or something comparable.

I'd still appreciate anyone elses pointers...
 
Old 01-09-2006, 12:32 PM   #9
TotalDefiance
Member
 
Registered: Jan 2004
Distribution: Slackware, RH, WBEL
Posts: 65

Rep: Reputation: 15
Well, I found a solution: using mod_auth_ldap rather than mod_authz_ldap.

I had authentication working with mod_auth_ldap in under a minute using the following .htaccess file:

Code:
SSLRequireSSL
AuthName "Admin Area (ADS Manager Credentials - No ADS Prefix/Suffix)"
AuthType Basic
AuthLDAPBindDN "CN=service_account,OU=ADManagers,DC=ads,DC=domain,DC=net"
AuthLDAPBindPassword "service_password"
AuthLDAPURL ldap://ldapserver.domain.net:389/OU=ADManagers,DC=ads,DC=domain,DC=net?sAMAccountName?sub?(objectClass=*)
require valid-user
Next up, secure LDAP.

Last edited by TotalDefiance; 01-09-2006 at 12:35 PM.
 
Old 01-09-2006, 12:34 PM   #10
TotalDefiance
Member
 
Registered: Jan 2004
Distribution: Slackware, RH, WBEL
Posts: 65

Rep: Reputation: 15
[ No Text ]

Last edited by TotalDefiance; 01-09-2006 at 12:35 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fedora Directory Server sync Active Directory paul_mat Linux - Networking 8 03-08-2007 10:51 AM
Apache Root/Home Directory and setting up FTP for home directories? Mankind75 Linux - Newbie 6 07-23-2006 02:37 PM
Apache Directory Listing Of NFS Mount, cannot view directory list via apache luqmana Linux - Networking 2 12-19-2005 06:03 AM
apache authenticate to Active Directory zuessh Linux - Software 1 07-08-2005 03:29 PM
Suse to AD - Active Directory alime SUSE / openSUSE 1 05-13-2005 10:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration