{"id":26,"date":"2007-06-07T13:12:59","date_gmt":"2007-06-07T12:12:59","guid":{"rendered":"\/Blog\/?p=26"},"modified":"2007-06-14T16:19:42","modified_gmt":"2007-06-14T15:19:42","slug":"pam_ldap-bugs-and-some-ssl","status":"publish","type":"post","link":"https:\/\/seegras.discordia.ch\/Blog\/pam_ldap-bugs-and-some-ssl\/","title":{"rendered":"pam_ldap, bugs and some SSL"},"content":{"rendered":"<p>Since I spent so much time in finding out why the hell sshd kept crashing when I turned on ldap-support, other people might as well profit from it. <\/p>\n<p>This is what happened after I turned on ldap-support in \/etc\/nsswitch.conf and \/etc\/pam.d. According to auth.log: <\/p>\n<blockquote><p>\n Jun  6 13:59:12 proto sshd[27433]: fatal: buffer_put_cstring: s == NULL<\/p><\/blockquote>\n<p>messages also knew something: <\/p>\n<blockquote><p> Jun  6 13:59:12 proto kernel: pid 27435 (sshd), uid 0: exited on signal 11<br \/>\n Jun  6 13:59:12 proto sshd[27433]: fatal: buffer_put_cstring: s == NULL<\/p><\/blockquote>\n<p>An sshd segmentation fault when trying to log in. According to what I&#8217;ve found in bug-reports, it does this if ldap.conf or nss_ldap.conf does not exist. Only these did exist in my case. debugging-output from nss_ldap turned up nothing, pam_ldap doesn&#8217;t even support a debug-flag: &#8220;This option is recognized by pam_ldap but is presently ignored.&#8221; Says so in the man-page. Thank you. <\/p>\n<p>The key to it was revealed by putting in &#8220;debug 5&#8221; into ldap.conf and starting sshd with debugging: <\/p>\n<blockquote><p>\n# \/usr\/sbin\/sshd -d -d -d<br \/>\n[snip]<br \/>\nldap_ndelay_off: 7<br \/>\nTLS trace: SSL_connect:before\/connect initialization<br \/>\nTLS trace: SSL_connect:SSLv2\/v3 write client hello A<br \/>\nTLS trace: SSL_connect:SSLv3 read server hello A<br \/>\ndebug1: do_cleanup<br \/>\nSegmentation fault: 11\n<\/p><\/blockquote>\n<p>Well, it seems you need either to use ldaps:\/\/servername and not ldaps:\/\/IP in ldap.conf so SSL knows which certificate needs to be used, AND it needs a correct certificate. On the other hand, if I just use ldap:\/\/servername without SSL, then local ssh works again, however I seem to have a problem with all the ldap-services. <\/p>\n<p>Some debugging of an sshd core-file reveals the following: <\/p>\n<blockquote><p>\n#928 0x0806820f in sshpam_thread (ctxtp=0x8079f80)<br \/>\n    at \/usr\/src\/secure\/usr.sbin\/sshd\/..\/..\/..\/crypto\/openssh\/auth-pam.c:469<br \/>\nPrevious frame inner to this frame (corrupt stack?)\n<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Since I spent so much time in finding out why the hell sshd kept crashing when I turned on ldap-support, other people might as well profit from it. This is what happened after I turned on ldap-support in \/etc\/nsswitch.conf and \/etc\/pam.d. According to auth.log: Jun 6 13:59:12 proto sshd[27433]: fatal: buffer_put_cstring: s == NULL messages [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-26","post","type-post","status-publish","format-standard","hentry","category-computers"],"_links":{"self":[{"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/posts\/26","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/comments?post=26"}],"version-history":[{"count":0,"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/posts\/26\/revisions"}],"wp:attachment":[{"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/media?parent=26"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/categories?post=26"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/tags?post=26"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}