I just saw some posts saying pam_krb winbind could be needed to get pam work against active directory. Is this true? The post I was following actually is for a LDAP server not Active Directory.<br><br><div class="gmail_quote">
On Mon, Nov 23, 2009 at 2:49 PM, Hailu Meng <span dir="ltr">&lt;<a href="mailto:hailumeng@gmail.com">hailumeng@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I think I need put my pam configuration here:<br><br>I followed this post <a href="http://www.shrubbery.net/pipermail/tac_plus/2009-January/000332.html" target="_blank">http://www.shrubbery.net/pipermail/tac_plus/2009-January/000332.html</a> to configure my pam module:<br>

<br>/etc/pam.d/tacacs<div class="im"><br>auth       include      system-auth<br>account    required     pam_nologin.so<br>account    include      system-auth<br>password   include      system-auth<br>session    optional     pam_keyinit.so force revoke<br>

session    include      system-auth<br>session    required     pam_loginuid.so<br><br>/etc/pam.d/system-auth<br>#%PAM-1.0<br># This file is auto-generated.<br># User changes will be destroyed the next time authconfig is run.<br>

auth        required      pam_env.so<br>auth        sufficient    pam_unix.so nullok try_first_pass<br>auth        requisite     pam_succeed_if.so uid &gt;= 500 quiet<br>auth        sufficient    pam_ldap.so use_first_pass<br>

auth        required      pam_deny.so<br><br>account     required      pam_unix.so broken_shadow<br></div>account     sufficient    pam_succeed_if.so uid &lt; 500 quiet<div class="im"><br>account     [default=bad success=ok user_unknown=ignore] pam_ldap.so<br>

account     required      pam_permit.so<br><br>password    requisite     pam_cracklib.so try_first_pass retry=3<br>password    sufficient    pam_unix.so md5 shadow nullok try_first_pass use_authtok<br>password    sufficient    pam_ldap.so use_authtok<br>

password    required      pam_deny.so<br><br>session     optional      pam_keyinit.so revoke<br>session     required      pam_limits.so<br>session     [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid<br>

session     required      pam_unix.so<br></div>session     optional      pam_ldap.so<div><div></div><div class="h5"><br><br><br><br><div class="gmail_quote">On Mon, Nov 23, 2009 at 2:33 PM, Hailu Meng <span dir="ltr">&lt;<a href="mailto:hailumeng@gmail.com" target="_blank">hailumeng@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi John,<br><br>You mean issue commands like tac_plus -C /etct/tac_plus.conf -L -p 49 -d 16 -d 256 -g ? -d 16 -d 256 side by side? It didn&#39;t make any change. I got same log info. By the way, I also saw the log info in /var/log/message:<br>


Nov 23 14:24:25 NMS tac_plus[3676]: Reading config<br>Nov 23 14:24:25 NMS tac_plus[3676]: Version F4.0.4.19 Initialized 1<br>Nov 23 14:24:29 NMS tac_plus[3676]: connect from 10.1.69.89 [10.1.69.89]<br>Nov 23 14:24:37 NMS tac_plus[3676]: login query for &#39;myuser&#39; tty0 from 10.1.69.89 rejected<br>


Nov 23 14:24:37 NMS tac_plus[3676]: login failure: myuser 10.1.69.89 (10.1.69.89) tty0<br><br>Do we have option to see the log about PAM? I haven&#39;t found where it is. if we can check the log of PAM, then we could find something useful. Right now the log of tac_plus didn&#39;t tell too much about why login got failure.<br>


<br>Lou<br><br><div class="gmail_quote"><div><div></div><div>On Mon, Nov 23, 2009 at 2:20 PM, john heasley <span dir="ltr">&lt;<a href="mailto:heas@shrubbery.net" target="_blank">heas@shrubbery.net</a>&gt;</span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div>
Mon, Nov 23, 2009 at 12:43:00PM -0600, Hailu Meng:<br>
<div>&gt; Thanks John for helping me check this issue.<br>
&gt;<br>
&gt; I just run tac_plus -C /path/to/tac_plus.conf -L -p 49 -d256 -g to see the<br>
<br>
</div>try -d 16 -d 256.  which i think will log the pwd that pam received from<br>
the device.  make its correct.  the logs below do appear to be a reject/fail<br>
returned from pam.<br>
</div></div><div><div></div><div><div><div></div><div><br>
&gt; log in stdout and in log file. I can&#39;t see any suspicious log information<br>
&gt; here. I paste the log below:<br>
&gt;<br>
&gt;<br>
&gt; Sat Nov 21 22:28:22 2009 [3393]: Waiting for packet<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: Read AUTHEN/CONT size=23<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: PACKET: key=mykey<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: version 192 (0xc0), type 1, seq no 5, flags<br>
&gt; 0x1<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: session_id 3295176910 (0xc46868ce), Data<br>
&gt; length<br>
&gt;  11 (0xb)<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: End header<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: type=AUTHEN/CONT<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: user_msg_len 6 (0x6), user_data_len 0 (0x0)<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: flags=0x0<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: User msg:<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: myusername<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: User data:<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: End packet<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: choose_authen chose default_fn<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: Calling authentication function<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: Writing AUTHEN/GETPASS size=28<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: PACKET: key=mykey<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: version 192 (0xc0), type 1, seq no 6, flags<br>
&gt; 0x1<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: session_id 3295176910 (0xc46868ce), Data<br>
&gt; length<br>
&gt;  16 (0x10)<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: End header<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: type=AUTHEN status=5 (AUTHEN/GETPASS)<br>
&gt; flags=0x1<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: msg_len=10, data_len=0<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: msg:<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: Password:<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: data:<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: End packet<br>
&gt; Sat Nov 21 22:28:27 2009 [3393]: Waiting for packet<br>
&gt; Sat Nov 21 22:28:34 2009 [3393]: Read AUTHEN/CONT size=30<br></div></div>
&gt; Sat Nov 21 22:28:34 2009 [3393]: PACKET: key=mykey<div><div></div><div><br>
&gt; Sat Nov 21 22:28:34 2009 [3393]: version 192 (0xc0), type 1, seq no 7, flags<br>
&gt; 0x1<br>
&gt; Sat Nov 21 22:28:34 2009 [3393]: session_id 3295176910 (0xc46868ce), Data<br>
&gt; length<br>
&gt;  18 (0x12)<br>
&gt; Sat Nov 21 22:28:34 2009 [3393]: End header<br>
&gt; Sat Nov 21 22:28:34 2009 [3393]: type=AUTHEN/CONT<br>
&gt; Sat Nov 21 22:28:34 2009 [3393]: user_msg_len 13 (0xd), user_data_len 0<br>
&gt; (0x0)<br>
&gt; Sat Nov 21 22:28:34 2009 [3393]: flags=0x0<br>
&gt; Sat Nov 21 22:28:34 2009 [3393]: User msg:<br>
&gt; Sat Nov 21 22:28:34 2009 [3393]: mypassword<br>
&gt; Sat Nov 21 22:28:34 2009 [3393]: User data:<br>
&gt; Sat Nov 21 22:28:34 2009 [3393]: End packet<br>
&gt; Sat Nov 21 22:28:36 2009 [3393]: login query for &#39;myusername&#39; tty0 from<br>
&gt; 10.1.69.89 r<br>
&gt; ejected<br>
&gt; Sat Nov 21 22:28:36 2009 [3393]: login failure: myusername 10.1.69.89<br>
&gt; (10.1.69.89) t<br>
&gt; ty0<br>
&gt; Sat Nov 21 22:28:36 2009 [3393]: Writing AUTHEN/FAIL size=18<br>
&gt; Sat Nov 21 22:28:36 2009 [3393]: PACKET: key=mykey<br>
&gt; Sat Nov 21 22:28:36 2009 [3393]: version 192 (0xc0), type 1, seq no 8, flags<br>
&gt; 0x1<br>
&gt; Sat Nov 21 22:28:36 2009 [3393]: session_id 3295176910 (0xc46868ce), Data<br>
&gt; length<br>
&gt;  6 (0x6)<br>
&gt; Sat Nov 21 22:28:36 2009 [3393]: End header<br>
&gt; Sat Nov 21 22:28:36 2009 [3393]: type=AUTHEN status=2 (AUTHEN/FAIL)<br>
&gt; flags=0x0<br>
&gt; Sat Nov 21 22:28:36 2009 [3393]: msg_len=0, data_len=0<br>
&gt; Sat Nov 21 22:28:36 2009 [3393]: msg:<br>
&gt; Sat Nov 21 22:28:36 2009 [3393]: data:<br>
&gt; Sat Nov 21 22:28:36 2009 [3393]: End packet<br>
&gt; Sat Nov 21 22:28:36 2009 [3393]: <a href="http://10.1.69.89" target="_blank">10.1.69.89</a>: disconnect<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Mon, Nov 23, 2009 at 12:23 PM, john heasley &lt;<a href="mailto:heas@shrubbery.net" target="_blank">heas@shrubbery.net</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; Mon, Nov 23, 2009 at 12:12:58PM -0600, Hailu Meng:<br>
&gt; &gt; &gt; Hi Adam,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; If the ldapsearch -D &quot;&quot; -w &quot;&quot; runs successfully, what do we suppose to<br>
&gt; &gt; get<br>
&gt; &gt; &gt; from the output? I just got all of the user information in that group.<br>
&gt; &gt; Does<br>
&gt; &gt; &gt; that means my password and username got authenticated successfully<br>
&gt; &gt; against<br>
&gt; &gt; &gt; AD?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; This thing drives me crazy. I need solve it through this week before the<br>
&gt; &gt; &gt; holiday...<br>
&gt; &gt;<br>
&gt; &gt; i havent followed this thread, as i know nearly zero about ldap.  but,<br>
&gt; &gt; have you enabled authentication debugging in the tacacas daemon and<br>
&gt; &gt; checked the logs to determine what is coming back from pam?  it very<br>
&gt; &gt; well may be that the ldap client is working just fine, but there is a<br>
&gt; &gt; pam module bug or a bug in the tacplus daemon or that your device<br>
&gt; &gt; simply doesnt like something about the replies.<br>
&gt; &gt;<br>
&gt; &gt; &gt; Thanks a lot for the help.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Lou<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; On Fri, Nov 20, 2009 at 7:26 AM, Hailu Meng &lt;<a href="mailto:hailumeng@gmail.com" target="_blank">hailumeng@gmail.com</a>&gt; wrote:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Still no clue how to turn on the log. binding seems good. See my<br>
&gt; &gt; findings<br>
&gt; &gt; &gt; &gt; below. Thanks a lot.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; On Thu, Nov 19, 2009 at 9:26 PM, adam &lt;<a href="mailto:prozaconstilts@gmail.com" target="_blank">prozaconstilts@gmail.com</a>&gt;<br>
&gt; &gt; wrote:<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; Hailu Meng wrote:<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt; Adam,<br>
&gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt; I tried the su - &quot;userid&quot; in my tacacs+ server but I don&#39;t have that<br>
&gt; &gt; &gt; &gt;&gt;&gt; userid in CentOS. So the CentOS just don&#39;t want me log in. I think<br>
&gt; &gt; this will<br>
&gt; &gt; &gt; &gt;&gt;&gt; not ask tacacs server to authenticate against AD.<br>
&gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; You shouldn&#39;t need to have to define the user in CentOS, that&#39;s the<br>
&gt; &gt; point<br>
&gt; &gt; &gt; &gt;&gt; of using ldap for authentication. The user is defined in ldap, not in<br>
&gt; &gt; &gt; &gt;&gt; CentOS. Now that I think about it, su - &lt;user&gt; probably wouldn&#39;t work<br>
&gt; &gt; &gt; &gt;&gt; anyway, as AD doesn&#39;t by default have the data needed by a linux box<br>
&gt; &gt; to<br>
&gt; &gt; &gt; &gt;&gt; allow login...but see below for more options.<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt; Is there any other way to test ldap authentication against AD with<br>
&gt; &gt; the<br>
&gt; &gt; &gt; &gt;&gt;&gt; userid in AD? I tried ldapsearch. It did find my user id without<br>
&gt; &gt; problem.<br>
&gt; &gt; &gt; &gt;&gt;&gt; But I haven&#39;t found any option to try with password and authenticate<br>
&gt; &gt; against<br>
&gt; &gt; &gt; &gt;&gt;&gt; AD.<br>
&gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; Try using -D:<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; from `man ldapsearch`:<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; -D binddn<br>
&gt; &gt; &gt; &gt;&gt;  Use the Distinguished Name binddn to bind to the LDAP directory.<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; so -D cn=username,ou=my_ou,dc=my_dc should let you try to authenticate<br>
&gt; &gt; &gt; &gt;&gt; using whatever user you want to define. Just check and double check<br>
&gt; &gt; you get<br>
&gt; &gt; &gt; &gt;&gt; the right path in that dn.<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; I tried -D &quot; cn=username,ou=my_ou,dc=my_dc &quot; but it just returned lots<br>
&gt; &gt; of<br>
&gt; &gt; &gt; &gt; users&#39; information. It means successful?<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt;  Do you have ldap server setup or only the openldap library and<br>
&gt; &gt; openldap<br>
&gt; &gt; &gt; &gt;&gt;&gt; client? I don&#39;t understand why the log is not turned on. There must<br>
&gt; &gt; be some<br>
&gt; &gt; &gt; &gt;&gt;&gt; debugging info in the log which can help solve this issue.<br>
&gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; only the libs and client. You should not need the server. In the<br>
&gt; &gt; &gt; &gt;&gt; ldapsearch, you can use -d &lt;integer&gt; to get debugging info for that<br>
&gt; &gt; search.<br>
&gt; &gt; &gt; &gt;&gt; As before, higher number = more debug<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;  If the user can authenticate, does ethereal capture some packets<br>
&gt; &gt; about<br>
&gt; &gt; &gt; &gt;&gt;&gt; password verification? Right now I only see the packets when ldap<br>
&gt; &gt; search for<br>
&gt; &gt; &gt; &gt;&gt;&gt; my user id and gets results back from AD.<br>
&gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; Ethereal should catch all data flowing between the client and server.<br>
&gt; &gt; If<br>
&gt; &gt; &gt; &gt;&gt; you can search out the user in your AD right now, then one of two<br>
&gt; &gt; things is<br>
&gt; &gt; &gt; &gt;&gt; happening:<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; 1. You are performing anonymous searches. In this case, no username<br>
&gt; &gt; and pw<br>
&gt; &gt; &gt; &gt;&gt; is provided, and your AD is happy to hand over info to anyone who asks<br>
&gt; &gt; for<br>
&gt; &gt; &gt; &gt;&gt; it. If this is the case, you will _not_ see authentication<br>
&gt; &gt; information. The<br>
&gt; &gt; &gt; &gt;&gt; following MS KB article should probably help you determine on your AD<br>
&gt; &gt; if<br>
&gt; &gt; &gt; &gt;&gt; anonymous queries are allowed:<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; <a href="http://support.microsoft.com/kb/320528" target="_blank">http://support.microsoft.com/kb/320528</a><br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; It has exact instructions for how to get it going, but you can follow<br>
&gt; &gt; &gt; &gt;&gt; along with it to check your current settings without making any<br>
&gt; &gt; changes.<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; I checked our setting. Permission type for normal user is &quot;Read &amp;<br>
&gt; &gt; Execute&quot;.<br>
&gt; &gt; &gt; &gt; I click edit to check the detail about permission. I think it only<br>
&gt; &gt; allow the<br>
&gt; &gt; &gt; &gt; user to read the attributes, permission something and can&#39;t modify the<br>
&gt; &gt; &gt; &gt; AD.There is &quot;Everyone&quot; setting is also set as &quot;Read &amp; Execute&quot;. By the<br>
&gt; &gt; way,<br>
&gt; &gt; &gt; &gt; the AD is Win2003 R2.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; 2. Authentication is happening. It will be the _very_ first thing the<br>
&gt; &gt; &gt; &gt;&gt; client and server perform, after basic connection establishment. Look<br>
&gt; &gt; for it<br>
&gt; &gt; &gt; &gt;&gt; at the very beginning of a dump.<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; Also, it&#39;s a bit overkill, but the following article is extremely<br>
&gt; &gt; &gt; &gt;&gt; informative about all the different ways you can plug linux into AD<br>
&gt; &gt; for<br>
&gt; &gt; &gt; &gt;&gt; authentication. It might offer some hints...<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt; Maybe I need dig into ldap.conf more. If you have any idea, let me<br>
&gt; &gt; know.<br>
&gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt; Thank you very much.<br>
&gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt; Lou<br>
&gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; -------------- next part --------------<br>
&gt; &gt; &gt; An HTML attachment was scrubbed...<br>
&gt; &gt; &gt; URL:<br>
&gt; &gt; <a href="http://www.shrubbery.net/pipermail/tac_plus/attachments/20091123/bba3d7fb/attachment.html" target="_blank">http://www.shrubbery.net/pipermail/tac_plus/attachments/20091123/bba3d7fb/attachment.html</a><br>



&gt; &gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; tac_plus mailing list<br>
&gt; &gt; &gt; <a href="mailto:tac_plus@shrubbery.net" target="_blank">tac_plus@shrubbery.net</a><br>
&gt; &gt; &gt; <a href="http://www.shrubbery.net/mailman/listinfo.cgi/tac_plus" target="_blank">http://www.shrubbery.net/mailman/listinfo.cgi/tac_plus</a><br>
&gt; &gt;<br>
</div></div></div></div></blockquote></div><br>
</blockquote></div><br>
</div></div></blockquote></div><br>