This procedure allows Linux-based systems to authenticate against Active Directory. We use Kerberos for authentication, LDAP for account information, and Samba to help automate the process along the way. When this process is complete, AD users can be enabled for use on Linux systems on the network and login to those Linux systems using the same username and password as throughout the rest of Active Directory.
These instructions are designed for use with Windows Server 2003 R2. If you are looking for information on using Linux with a previous version of Windows, please refer back to this article. The only significant changes in the process involve the mapping of the LDAP attributes; otherwise, the procedure is very similar between the two versions of Windows.
Preparing Active Directory (One-Time)
Enable Editing/Display of UNIX Attributes
Based on my research, it appears that the partially RFC 2307-compliant schema is installed with Windows Server 2003 R2; this means that the schema does not need to be extended to include UNIX-specific attributes such as uid, gid, login shell, etc. However, while the attributes are there in the schema, there is no way to edit those attributes, and these attributes must be populated correctly in order for this process to work.
The easiest way to enable the editing of these attributes is to install the “Server for NIS” component on at least one domain controller. This will cause a new tab, labeled “UNIX Attributes,” to appear in the properties dialog box for users and groups. You’ll use this tab to edit the UNIX-specific attributes that are required for logins to Linux-based systems. Please note that due to the way this tab is displayed, you’ll need Schema Admin privileges in order to install the “Server for NIS” component on your domain controller. (More information on this issue is available here.)
You could just as well use LDP, LDIF files, ADSI Edit, or any number of other methods to display and edit these attributes. To make this process as seamless as possible, however, you’ll want to integrate the management of these attributes into Active Directory Users and Computers using the method described above.
Create an LDAP Bind Account
You’ll also need to create an account in Active Directory that will be used to bind to Active Directory for LDAP queries. This account does not need any special privileges; in fact, making the account a member of Domain Guests and not a member of Domain Users is perfectly fine. This helps minimize any potential security risks as a result of this account.
Prepare Active Directory (Each User)
Each Active Directory account that will authenticate via Linux must be configured with a UID and other UNIX attributes. This is accomplished via the new “UNIX Attributes” tab on the properties dialog box of a user account. (Installing the “Server for NIS” component enables this, as mentioned previously.)
After all the user accounts have been configured, then we are ready to configure the Linux server(s) for authentication against Active Directory.
Prepare Each Linux Server
Follow the steps below to configure the Linux server for authentication against Active Directory.
- Edit the
/etc/hostsfile and ensure that the server’s fully-qualified domain name is listed first after its IP address. - Make sure that the appropriate Kerberos libraries, OpenLDAP, pam_krb5, and nss_ldap are installed. If they are not installed, install them.
- Be sure that time is being properly synchronized between Active Directory and the Linux server in question. Kerberos requires time synchronization. Configure the NTP daemon if necessary.
- Edit the
/etc/krb5.conffile to look something like this, substituting your actual host names and domain names where appropriate:[logging] default = FILE:/var/log/krb5libs.log kdc = FILE:/var/log/krb5kdc.log admin_server = FILE:/var/log/kadmind.log [libdefaults] default_realm = EXAMPLE.COM dns_lookup_realm = true dns_lookup_kdc = true [realms] EXAMPLE.COM = { kdc = host.example.com:88 admin_server = host.example.com:749 default_domain = example.com } [domain_realm] .example.com = EXAMPLE.COM example.com = EXAMPLE.COM [kdc] profile = /var/kerberos/krb5kdc/kdc.conf [appdefaults] pam = { debug = false ticket_lifetime = 36000 renew_lifetime = 36000 forwardable = true krb4_convert = false } - Edit the
/etc/ldap.conffile to look something like this, substituting the appropriate host names, domain names, account names, and distinguished names (DNs) where appropriate. (Please note that thenss_base_groupline should not be broken across two lines when you edit it; it has been wrapped here for readability.) (Note: These schema mappings assume that you are using the newer schema extensions provided by Windows Server 2003 R2. If you are using SFU 3.5 instead, you will need to use the schema mappings described here.)host 10.10.10.10 base dc=example,dc=com uri ldap://server.example.com/ binddn [email protected] bindpw adldapbindpw scope sub ssl no nss_base_passwd dc=example,dc=com?sub nss_base_shadow dc=example,dc=com?sub nss_base_group dc=mydomain,dc=com?sub? &(objectCategory=group)(gidnumber=*) nss_map_objectclass posixAccount user nss_map_objectclass shadowAccount user nss_map_objectclass posixGroup group nss_map_attribute gecos cn nss_map_attribute homeDirectory unixHomeDirectory nss_map_attribute uniqueMember member
- Configure PAM (this varies according to Linux distributions) to use
pam_krb5for authentication. Many modern distributions use a stacking mechanism whereby one file can be modified and those changes will applied to all the various PAM-aware services. For example, in Red Hat-based distributions, thesystem-authfile is referenced by most other PAM-aware services. Here’s a properly edited/etc/pam.d/system-authfile taken from CentOS 4.4 (some lines have been wrapped for readability; do not wrap them when editing the file):#%PAM-1.0 # This file is auto-generated. # User changes will be destroyed the next time authconfig is run. auth required /lib/security/$ISA/pam_env.so auth sufficient /lib/security/$ISA/pam_unix.so likeauth nullok auth sufficient /lib/security/$ISA/pam_krb5.so auth required /lib/security/$ISA/pam_deny.so account sufficient /lib/security/$ISA/pam_unix.so account sufficient /lib/security/$ISA/pam_krb5.so account sufficient /lib/security/$ISA/pam_succeed_if.so uid < 100 quiet account required /lib/security/$ISA/pam_deny.so password requisite /lib/security/$ISA/pam_cracklib.so retry=3 password sufficient /lib/security/$ISA/pam_unix.so nullok use_authtok md5 shadow password required /lib/security/$ISA/pam_deny.so session required /lib/security/$ISA/pam_limits.so session required /lib/security/$ISA/pam_unix.so - Edit the
/etc/nsswitch.conffile to include “ldap” as a lookup source for passwd, shadow, and groups.
At this point we are now ready to test our configuration and, if successful, to perform the final step: to join the Linux server to Active Directory for authentication.
Test the Configuration
To test the Kerberos authentication, use the kinit command, as in kinit <AD username>@<AD domain DNS name>; this should return no errors. A klist at that point should then show that you have retrieved a TGT (ticket granting ticket) from the AD domain controller. If this fails, go back and troubleshoot the Kerberos configuration. In particular, if you are seeing references to failed TGT validation, check to make sure that both your Linux servers and AD domain controllers have reverse lookup (PTR) records in DNS and that the Linux server’s /etc/hosts file listed the FQDN of the server first instead of just the nodename.
<aside>Some readers and some other articles have suggested the use of the AD domain DNS name in the /etc/krb5.conf file instead of an AD domain controller specifically; I recommend against this. First, I believe it may contribute to TGT validation errors; second, it is possible to list multiple KDCs (AD DCs) in the configuration. Since the only major reason to use the AD domain DNS name instead of the DNS name of one or more DCs would be fault tolerance, then it doesn’t really gain anything.</aside>
To test the LDAP lookups, use the getent command, as in getent passwd <AD username>; this should return a listing of the account information from Active Directory. If this does not work, users will not be able to login, even if Kerberos is working fine. If you run into errors or failures here, go back and double-check the LDAP configuration. One common source of errors is the name of the LDAP bind account, so be sure that is correct.
Join the Linux Server to Active Directory
This is the final step. Don’t try this step until you’ve successfully tested the configuration. After this step is completed, you are finished and AD users will be able to login to Linux-based systems (assuming the AD users have been properly configured for Linux logins).
To join the Linux server to Active Directory, follow these steps:
- Verify the Samba configuration. Be sure the following settings are specified in
/etc/samba/smb.conf:workgroup = <NetBIOS name of AD domain> security = ads realm = <DNS name of AD domain> use kerberos keytab = true password server = <Space-delimited list of AD DCs>
- Use
kdestroyto destroy any existing Kerberos credentials you may have; then runkinit <Domain administrative account>@AD.DOMAIN.NAMEto get a Kerberos ticket for an account that is a domain administrator account. - Run
net ads jointo join the Linux server to Active Directory. This command will automatically create a computer object in Active Directory and add the appropriate SPNs (service principal names) to the computer object. In addition, it will populate the local Kerberos key table (/etc/krb5.keytab, by default) with the correct entries for authentication against Active Directory.
Only one small detail remains: how to deal with home directories for users logging into Linux systems.
Deal with Home Directories
Unlike Windows systems, home directories are required on Linux-based systems. As a result, we must provide home directories for each AD user that will log in to a Linux-based system. We basically have two options here:
- Use the
pam_mkhomedir.soPAM module to automatically create local home directories “on the fly” as users log in. To do this, you would add an entry forpam_mkhomedir.soin the session portion of the PAM configuration file. - Use the automounter to automatically mount home directories from a network server. This process is fairly complicated (too involved to include the information here), so I’ll refer you to this article on using NFS and automounts for home directories. This has the added benefit of providing a foundation for unified home directories across both Windows and Linux systems.
(There is a third option as well: manually create home directories before users can log in.)
Once you’ve settled on and implemented a system for dealing with home directories, you are finished! UNIX-enabled users in Active Directory can now login to Linux-based systems with their Active Directory username and password.
What’s not addressed in this article? Password management. In this configuration, users will most likely not be able to change their password from the Linux servers and have that change properly reflected in Active Directory. I’ll try to work on that for version 5 of the instructions.
I hope you find this information helpful. As always, feel free to post corrections, additions, or suggestions in the comments below.
Tags: ActiveDirectory, CentOS, Interoperability, Kerberos, LDAP, Linux, Microsoft, Samba, SSH
-
Hello
Net ads join is working OK on my Ubuntu, is it possible to do it on Solaris 10 ? How dou you think ? -
Scott,
I was able to use your procedures to setup kerberos authentication to AD and
user/group authorization to AD Windows2003 RC2.After I logon to the Linux server with using openssh, I do not have a kerberos ticket.
:/> klist
klist: No ticket file: /tmp/krb5cc_145538Any idea on how to get a ticket automatically? I can issue a kinit command to get a ticket
but I thought the reason you were getting the server keytab was to allow the OS to get
the ticket for us. -
Scott,
Taking all of this into account, does it matter if I want to raise the domain/forest functional level to the highest setting, or does it have to remain in mixed mode?
Thanks,
Ron
-
I have the single sign on working but would like to prevent user from AD to logon unless they are a member of a certain group. Any ideas on how to do this?
Thanks,
Leonard
-
Hi Scott,
thanks for a *very* useful howto on linux-ad integration! I had been trying to get this to work for some time now.
One remark: although I was working with a freshly installed Win 2003 R2 server (with SFU 3.5 installed) I had to use the old schema mappings in /etc/ldap.conf. It took me a while to figure this out. You may want to add this as a remark in your text.
Thanks again!
Nico
-
I’m curious about the ‘Join the server to AD’ portion of this. It seems that once you have setup nss_ldap & krb5/pam_krb5, you will have functional authentication and authorization from AD on the system already (even with no samba). What additional benefits are gained from the join portions of the procedure?
-
Ok, so I’m correct in what I was assuming is this is an alternate method of populating the keytab rather than the method used in the Solaris document (and Microsoft’s) where it’s exported via ktpass and manually migrated across. I just wanted to make sure this wasn’t doing some voodoo magic that I couldn’t see, since I don’t have samba-common in the base system.
Have you done any work in the DNS based distribution of ADS communication from clients a-la what Windows clients natively do? That’s my next step. I think it may simply not be feasible though, and they will end up statically mapped to a pair of DCs.
-
This would solve it for the krb5 portion, but I don’t think it would work for LDAP (in any method that I know) — which would leave you with authentication but no authorization. Is this incorrect?
-
Scott,
Any new update on password management ? Thanks.
-
I have SSO working but I have a question. I can not add a local user since users authenticate to AD. Is it possible to add local users?
-
I had been trying to get this. It is really work. But one question. When in AD on any account I make “User must change password at next logon” – receive next messages
login: test2
Password for [email protected]:
Password expired. You must change it now.Access denied
Using keyboard-interactive authentication.
Password for [email protected]:I can’t change password. Why?
-
Scott, thanks for this awesome website, everything worked out as you outlined it here. I am now trying to figure out how to get Password Synchronization working.
-
JS, would you be so kind as to share what information you used to get SSO working? Thanks, Sean
-
After following your steps to the letter I have this mostly working, however, I frequently get errors like this:
[root@ad-linux ~]# ls -la /home
ls: ../../../libraries/liblber/sockbuf.c:90: ber_sockbuf_ctrl: Assertion `sb != ((void *)0)’ failed.
Aborted
[root@ad-linux ~]# ls -la /home
total 20
drwxr-xr-x 3 root root 4096 Mar 14 18:15 .
drwxr-xr-x 23 root root 4096 Mar 14 17:35 ..
drwxr-xr-x 2 csmith 10000 4096 Mar 14 18:15 csmith
[root@ad-linux ~]#Any ideas ?
CS
-
Sorry, I should have provided some more details…
This is a bone-stock CentOS 4.4 installation, done from scratch specifically to proof-of-concept this authentication. I’ve actually since reinstalled the machine again and it’s still returning the same errors. Additionally, anything that involves sucking down user information (eg: getent passwd, ls’ing a directory with files/directories owned by AD users, etc) is extremely slow.
The DC is on the same network segment as the Linux machine and isn’t under any sort of load, so I don’t think that’s the problem.
Since I’m using CentOS and you used CentOS, I’m just trying to figure out why we don’t have the same problems
.I am contemplating using SFU’s NIS server instead to grab the user information. A quick test indicates that it would work and doesn’t seem to have the “crashing” issue, but it’s still very slow. Thoughts ?
CS
(PS: I had these exact same issues the last time I tried to get this up and running, ~12 months ago – I just assumed at the time it was some bugs in the libraries that would be ironed out over time. Guess not…)
-
Fixed it ! The culprit was “LDAP referrals”. Having just spent several hours figuring it out, this actually refreshed my memory that it was the same problem – and its cause – that stopped me implementing this the last time (which, in my defense, was 18 – 24 months ago, now that I go back and search my emails, not 12 months).
We have a slightly complicated domain structure in that we have multiple child domains (for each branch office). With referrals turned on, nss_ldap recurses down from domain.com to child1.domain.com, child2.domain.com, etc before returning results. There must be something that happens in this process that sometimes triggers the errors I was seeing (because they appear at random) and also causing the slowdowns.
If you put:
referrals no
into /etc/ldap.conf, the problems all go away (or, at least, they haven’t happened since – with these sort of random errors you never can be 100% sure
). Response time is also substantially faster.I can get away with this _now_ because (for unrelated reasons) we are flattening our domain structure and nixing the child domains. Previously this was not an option so any authentication system had to be able to include users in the child domains.
I also seem to vaguely recall that you can get around much of the slowness related to multi-domain configurations by a) pointing at a DC that is a Global Catalogue and b) pointing at the GC port instead of the regular LDAP port. This didn’t help the random crashes with things like ‘getent group’ though, IIRC.
Well, now all I need to do is get the automounter going with NFS’d home directories, and we’ll be golden. I might have to bend your ear about that shortly as well
.CS
-
Any ideas on how to set this up for Suse Linux Enterprise Desktop 10 -specifically the pam modules configuration section since they are a bit different from CentOS?
Thanks for the great information!
Shannon VanWagner
-
Hi Scott,
Thanks for your reply. Here’s a more detailed description of my problem with configuration file information included:
RE: Sled 10 System Hangs When Using Ldap / kerberos To Authenticate To Server 2003 R2
I’ve configured LDAP/Kerberos authentication on SLED 10 and am trying to authenticate to Active Directory on Windows Server 2003 R2. Note: the UNIX attributes for each user are showing up in active directory.
The authentication seems to work as it lets me login as a Windows user. I can also run id and get the correct uid for that user. However, after logging in there are serious system performance issues (to the point where the system freezes up after about 10 min).
wbinfo -u and wbinfo -g show all domain users and domain groups as expected
However, when I run the getent passwd or getent group commands I get a listing that shows some of the Active Directory users and then the listing gets stuck and never returns to the command line. After that, if I don’t use CTRL+C to exit the getent listing, the computer freezes up as if it’s stuck in a loop or something.
I’ve already successfully had authentication working properly with the same client/server using winbind instead of ldap – that solution doesn’t give me the uid/gid mapping I need however. This makes me think there’s something I’m missing with the ldap configuration or something.
Here are my configs:
——————— /etc/nsswitch.conf——————————
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry ‘[NOTFOUND=return]‘ means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
# compat Use compatibility setup
# nisplus Use NIS+ (NIS version 3)
# nis Use NIS (NIS version 2), also called YP
# dns Use DNS (Domain Name Service)
# files Use the local files
# [NOTFOUND=return] Stop searching if not found so far
#
# For more information, please read the nsswitch.conf.5 manual page.
## passwd: files nis
# shadow: files nis
# group: files nispasswd: compat ldap
shadow: compat ldap
group: compat ldaphosts: files dns
networks: files dnsservices: files
protocols: files
rpc: files
ethers: files
netmasks: files
netgroup: files nis
publickey: filesbootparams: files
automount: files nis
aliases: files—————————–/etc/ldap.conf———————————-
host 10.10.0.10
base dc=mydomain,dc=com
uri ldap://host1.mydomain.com/
binddn cn=linuxldap,cn=Users,dc=mydomain,dc=com
bindpw mypassword
scope sub
bind_timelimit 15
timelimit 15
ssl no
nss_base_passwd dc=mydomain,dc=com?sub
nss_base_shadow dc=mydomain,dc=com?sub
nss_base_group dc=mydomain,dc=com?sub?&(objectCategory=group)(gidnumber=*)
nss_map_objectclass posixAccount user
nss_map_objectclass shadowAccount user
nss_map_objectclass posixGroup group
nss_map_attribute gecos cn
nss_map_attribute homeDirectory unixHomeDirectory
nss_map_attribute uniqueMember member
nss_initgroups_ignoreusers root,ldap———————————–/etc/samba/smb.conf—————————–
sldtenghst:~ # cat /etc/samba/smb.conf
# smb.conf is the main Samba configuration file. You find a full commented
# version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the
# samba-doc package is installed.
# Date: 2007-02-07
[global]
workgroup = INTERNAL
realm = MYDOMAIN.COM
security = ads
use kerberos keytab = true
password server = host1.mydomain.com
netbios name = suse10box
winbind use default domain = yes
winbind separator = +
idmap uid = 1000-29999
idmap gid = 1000-29999
winbind enum users = yes
winbind enum groups = yes
#deadtime = 15
#winbind cache time = 10
winbind nested groups = yes
template homedir = /home/%U
template shell = /bin/bash
client use spnego = yes
socket options = TCP_NODELAY SO_RCVBUF=16384 SO_SNDBUF=16384
dns proxy = no
domain master = no
preferred master = no
max log size = 100
log file = /var/log/samba/%m.log
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
map to guest = Bad User
include = /etc/samba/dhcp.conf
logon path = \%L\profiles\.msprofile
logon home = \%L\%U\.9xprofile
logon drive = P:
usershare allow guests = Yes—————————————–/etc/pam.d/common-auth—————
auth required pam_env.so
auth sufficient pam_krb5.so
auth required pam_unix2.so—————————————-/etc/pam.d/common-account————-
account sufficient pam_krb5.so
account required pam_unix2.so—————————————-/etc/pam.d/common-password———–
password required pam_pwcheck.so nullok
password required pam_unix2.so nullok use_first_pass use_authtok—————————————-/etc/pam.d/common-session
session required pam_limits.so
session required pam_unix2.so
session required pam_mkhomedir.so umask=0077 skel=/etc/skel—————————————————-
Thanks again!
-
Scott,
The previous posting from CS fixes my problem with LDAP hanging up!!
(per the posting by CS above) I put this in the /etc/ldap.conf file:
referrals no
The system hangup on getent passwd has disappeared – Thanks VERY MUCH to CS and Scott for having this information posted online!!Now my NEW problem is that I don’t seem to have my pam files configured correctly..
I can su and that works great (with correct uid) but I can’t login at the front screen of the computer.The errors logged in /var/log/messages show:
gdm[pid] pam_krb5[pid]: error resolving user name ‘windows-user’ to uid/gid pair
gdm[pid] pam_krb5[pid]: error getting information about ‘windows-user’
gdm[pid] pam_krb5[pid]: Couldn’t authenticate userI’m thinking I need to add pam_ldap to my pam config files but I’m not exactly sure
Thanks very much for your assistance!!
-
*****************UPDATE 2***************************
Fixed the above problem with a posting by “weeden” at
——————————–original posting—————————————————
I found this which solved most of the problems.
http://www.redmondmag.com/columns/article.asp?EditorialsID=858It doesn’t mention the following changes to the smb.conf file
idmap backend = ldap:ldap://ldapserver.domain.com
ldap idmap suffix = dc=domain,dc=com
ldap admin dn = cn=Administrator,cn=Users,dc=domain,dc=com
ldap suffix = dc=domain,dc=comSave the conf file and run “smbpasswd -w ADMIN_DN_PASSWORD”
Then run: (to get the Windows User’s Passwords and Groups)
getent passwd
getent groupAdd to /etc/pam.d/system-auth
session optional /lib/security/$ISA/pam_mkhomedir.soAnd you’re ready to go! You will now beable to login via X with your Windows user name and password
——————————–original posting end———————————————–Now I have a NEW problem:
When I su , I don’t get prompted to enter a password. Do you know how to configure my pam configs so that when su’ing to any windows user (as root) I will get the password prompt for that user? (example: su administrator — no password prompt).
Thanks very much!
-
Note: the previous comment should say that I found the information in a comment left by user “weeden” at http://forums.fedoraforum.org/archive/index.php/t-29825.html
-
SUSE Linux Enterprise Desktop ( SLED ) 10 Single Sign-On LDAP / Kerberos Authentication to Active Directory on Windows Server 2003 R2
Important Note: It’s been a bit of an emotional roller coaster for two weeks (with much blood, sweat, and tears involved) getting this to work… What’s depressing is that I haven’t found any resource that gives me absolute specific instructions on how to set this up for SLED 10.
Hehe, It’s time to “jerk the chain” a little for the Novell SLED 10 phone support…. I’d like to mention that I’ve called this whole problem in as a support ticket to Novell – I told them that I was fully able to authenticate with winbind from SLED 10 to Windows AD. The problem was that the winbind method didn’t appear to offer any way to sync user/group UID/GID across platforms, Novell confirmed this is true. The support guy actually said I should install eDirectory (Novell Product – go figure) in order to use LDAP authentication from SLED 10 to AD… Apparently Novell’s support team is not fully aware of the fact that Windows Server 2003 R2 is ready (out of the box) to support authentication and user/group UID/GID mapping from Active Directory LDAP to SLED 10. Hopefully Novell will catch on to this useful fact quick so that more sysadmins such as myself can use SLED 10 to its greatest ability for the great OS it is. SLED 10 truly is a very nice product!! Good Job Suse Devs, and Thanks!
So here’s how to configure SLED 10 to connect with Server 2003 R2 Active Directory via LDAP…
(Editor’s Note: The remainder of the information in Shannon’s comment has been moved into a post of its own:
http://blog.scottlowe.org/2007/03/22/sled-integration-into-active-directory/
The information was detailed enough and extensive enough that I felt it warranted a full blog posting of its own. -SL)
-
this guide grows up very interestingly. great!
I still have no solved my problem where in SuSE10.1 sometime any process that involves the LDAP query hangs eating all the CPU. I found that disabling the group mapping in ldap.conf everything goes fine.
Anyhow, my new question is if it is possible to renew the kerberos ticket got at the login.
I mean, the ticket expires after sometime, I could renew it by hand but I have to check periodically if it’s going to expire or not. On the other side users are not so skilled to do a kinit any X hours so they cannot access to many kerberized applications.thanks for any input
-
I spent much time to get ktpasswd work (Heimdal was saying “Soft error”, MIT – “Password change rejected”). As I expected, solution was simpe: password change via ktpasswd didn’t work only because of one thing in domain group policy: by default in AD environment password can’t be changed by user more often then once per day
My install:
Fresh Windows Server 2003 R2 Std, FreeBSD 6.2 with Heimdal(base) or MIT(ports). -
Hi!
I’m trying to implement this integration in a test environment. I’m not an expert, and i run into a problem I’m not sure about.
I followed you instructions, and installed the libraries on a newly installed Debian. However, after that i ended up with an /etc/ldap/ldap.conf file and with an /etc/libnss-ldap.conf one.
You say i should put the ldap configs in /etc/ldap.conf … now, what should i do?
1, create the file /etc/ldap.conf?
2, edit /etc/ldap/ldap.conf?
3, edit /etc/libnss-ldap.conf?I’m not sure which one is the correct solution, and i don’t want to mess up something in the long run.
Thanks.
-
Hello!
I hit another problem. The kerberos test is woking fine (kinit&klist) however i do not get any data with getent. I did try placing the ldap information in all 3 files (one at a time, and also everywhere)
As far as i know PAM should not effect the results of getent, right? Only the nsswitch.conf, which is:
passwd: ldap compat
group: ldap compat
shadow: ldap compathosts: files dns
networks: filesprotocols: db files
services: db files
ethers: db files
rpc: db filesnetgroup: nis
Any idea what could be the problem?
Config files:
krb5.conf
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log[libdefaults]
default_realm = TESTDOMAIN.LOCAL
dns_lookup_realm = true
dns_lookup_kdc = true[realms]
TESTDOMAIN.LOCAL = {
kdc = mmserverr2.testdomain.local:88
admin_server = mmserverr2.testdomain.local:749
default_domain = testdomain.local
}[domain_realm]
.testdomain.local = TESTDOMAIN.LOCAL
testdomain.local = TESTDOMAIN.LOCAL[kdc]
profile = /var/kerberos/krb5kdc/kdc.conf[appdefaults]
pam = {
debug = false
ticket_lifetime = 36000
renew_lifetime = 36000
forwardable = true
krb4_convert = false
}———
ldap.conf:
host 192.168.0.5
base dc=testdomain,dc=local
uri ldap://192.168.0.5/
binddn [email protected]
bindpw ***
scope sub
ssl no
nss_base_passwd dc=testdomain,dc=local?sub
nss_base_shadow dc=testdomain,dc=local?sub
nss_base_group dc=testdomain,dc=local?sub?&(objectCategory=group)(gidnumber=*)
nss_map_objectclass posixAccount user
nss_map_objectclass shadowAccount user
nss_map_objectclass posixGroup group
nss_map_attribute gecos cn
nss_map_attribute homeDirectory unixHomeDirectory
nss_map_attribute uniqueMember member -
Hi,
Yes, the password is correct, i can login with the password for the bind user account on the windows.
As for dns, each machine has an A and a PTR record, in the dns server (which is the domain controller itself). Besides that, everything is left default as the win2k3 r2 made it after completing a new install and adding the AD and DNS roles.
Can’t test “id” right now, will do tomorrow. But if i read it right, it resolves the username to uid, right? It should get its info from the ldap too :\ So i suspect it wont work.
No firewall is present.
-
Hi Scott,
After reinstalling the debian to make sure I did not make any misstakes it still does not work. However i did play with ldapsearch to see if the connection does work at all or not, and here is the result:
debian:/# ldapsearch -x -b “dc=testdomain,dc=local” “(objectclass=*)”
# extended LDIF
#
# LDAPv3
# base with scope subtree
# filter: (objectclass=*)
# requesting: ALL
## search result
search: 2
result: 1 Operations error
text: 00000000: LdapErr: DSID-0C090627, comment: In order to perform this ope
ration a successful bind must be completed on the connection., data 0, vece# numResponses: 1
So, according to this, there is sime kind of bind problem…. but what? The bind user exists nad the password is correct (can log in on windows)…
One question maybe: do i have to configure the unix attributes on windows for this bind user too? Like putting it into a nis domain?
-
Update:
I was wrong, the ldapsearch does not take the bind parameters from the ldap.conf file, instead its specified int he cmd line. And after doing so, it did list the ldap info from the windows server.
So, the ldap connection works, can use the bind user…. why does not work the getent?



177 comments
Comments feed for this article
Trackback link: http://blog.scottlowe.org/2007/01/15/linux-ad-integration-version-4/trackback/