我有完整的pipe理员权限访问我正在尝试进行身份validation的AD '08服务器。
错误代码意味着无效的凭据,但我希望这是像我input错误的密码一样简单。
首先,我有一个工作在相同的域的Apache mod_ldapconfiguration。
AuthType basic AuthName "MYDOMAIN" AuthBasicProvider ldap AuthLDAPUrl "ldap://10.220.100.10/OU=Companies,MYCOMPANY,DC=southit,DC=inet?sAMAccountName?sub?(objectClass=user)" AuthLDAPBindDN svc_webaccess_auth AuthLDAPBindPassword mySvcWebAccessPassword Require ldap-group CN=Service_WebAccess,OU=Groups,OU=MYCOMPANY,DC=southit,DC=inet
我展示了这一点,因为它可以在不使用任何Kerberos的情况下工作,因为许多其他向导都build议将系统身份validation用于AD。
现在我想把它翻译成pam_ldap.conf来与OpenSSH一起使用。
/etc/pam.d/common-auth部分很简单。
auth sufficient pam_ldap.so debug
这行在任何其他之前被处理。
我相信真正的问题是configurationpam_ldap.conf。
host 10.220.100.10 base OU=Companies,MYCOMPANY,DC=southit,DC=inet ldap_version 3 binddn svc_webaccess_auth bindpw mySvcWebAccessPassword scope sub timelimit 30 pam_filter objectclass=User nss_map_attribute uid sAMAccountName pam_login_attribute sAMAccountName pam_password ad
现在我一直在使用wireshark监视AD主机上的ldapstream量。 我从Apache的mod_ldap中捕获了一个成功的会话,并将其与来自pam_ldap的失败会话进行了比较。
第一个绑定请求是使用svc_webaccess_auth帐户成功的,searchrequest是成功的,返回1的结果。使用我的用户的最后一个绑定请求失败,返回上述错误代码。
除了search请求filter中的这一行外,其他所有内容都是相同的,这里显示的是mod_ldap。
Filter: (&(objectClass=user)(sAMAccountName=ivasta))
第二个是pam_ldap。
Filter: (&(&(objectclass=User)(objectclass=User))(sAMAccountName=ivasta))
我的用户名为ivasta。 但是,searchrequest不会返回失败,它返回1结果。 我也试过在cli上使用ldapsearch。
这是继上面的错误代码52e失败的searchrequest的绑定请求。
这是最后的bindrequest的失败信息。
resultcode: invalidcredentials (49) 80090308: LdapErr: DSID-0C0903AA, comment: AcceptSecurityContext error, data 52e, v1772
这应该意味着无效的密码,但我已经与其他用户和非常简单的密码尝试。
有没有人从pam_ldap和AD的斗争中认识到这一点?
编辑:值得注意的是,我也尝试了pam_password crypt,和pam_filter sAMAccountName = User,因为这在使用ldapsearch时有效。
ldapsearch -LLL -h 10.220.100.10 -x -b "ou=Users,ou=mycompany,dc=southit,dc=inet" -v -s sub -D svc_webaccess_auth -W '(sAMAccountName=ivasta)'
这可以使用svc_webaccess_auth帐户密码。 这个帐户已经扫描访问该OU用于Apache的mod_ldap。
编辑2:这是我在AD '08日志中得到的,当我login失败。
An account failed to log on. Subject: Security ID: SYSTEM Account Name: WIN-DC02$ Account Domain: SOUTHIT Logon ID: 0x3e7 Logon Type: 3 Account For Which Logon Failed: Security ID: NULL SID Account Name: ivasta Account Domain: SOUTHIT Failure Information: Failure Reason: Unknown user name or bad password. Status: 0xc000006d Sub Status: 0xc000006a Process Information: Caller Process ID: 0x264 Caller Process Name: C:\Windows\System32\lsass.exe Network Information: Workstation Name: WIN-DC02 Source Network Address: 10.220.100.105 Source Port: 44565 Detailed Authentication Information: Logon Process: Advapi Authentication Package: MICROSOFT_AUTHENTICATION_PACKAGE_V1_0 Transited Services: - Package Name (NTLM only): - Key Length: 0 This event is generated when a logon request fails. It is generated on the computer where access was attempted. The Subject fields indicate the account on the local system which requested the logon. This is most commonly a service such as the Server service, or a local process such as Winlogon.exe or Services.exe. The Logon Type field indicates the kind of logon that was requested. The most common types are 2 (interactive) and 3 (network). The Process Information fields indicate which account and process on the system requested the logon. The Network Information fields indicate where a remote logon request originated. Workstation name is not always available and may be left blank in some cases. The authentication information fields provide detailed information about this specific logon request. - Transited services indicate which intermediate services have participated in this logon request. - Package name indicates which sub-protocol was used among the NTLM protocols. - Key length indicates the length of the generated session key. This will be 0 if no session key was requested
我的腿之间的尾巴我将不得不回答这一个,因为我有尴尬的内幕信息。
我没有意识到你必须在系统上创build一个普通的Unix用户才能login。 只要我创build了一个匹配ivasta的用户,我就可以使用该用户的AD密码login。
唯一不能做的就是改变密码,即使是使用pam_password的广告,但这并不重要,因为这只是用于用户名logging的目的。