{"id":253,"date":"2013-07-31T15:54:45","date_gmt":"2013-07-31T15:54:45","guid":{"rendered":"http:\/\/liniks.com\/?p=253"},"modified":"2013-07-31T17:32:22","modified_gmt":"2013-07-31T17:32:22","slug":"spacewalk-pam-and-centrify-oh-my","status":"publish","type":"post","link":"https:\/\/liniks.com\/?p=253","title":{"rendered":"Spacewalk, PAM, and Centrify&#8230;oh, my!"},"content":{"rendered":"<p>So, I&#8217;ve been spending a good portion of the last six months designing a software distribution system, and looking for a good way to manage user access in an AD environment, where LDAP is fractured, at best. A few months ago, we were approved to procure Centrify as a provider of AD integration, so we could get rid (entirely) of winbind, \u00a0and samba related services.<\/p>\n<p>Finally, we are approaching handover, and time to integrate Spacewalk is here.<\/p>\n<p>Spacewalk does NOT integrate directly to Active Directory. Never has, probably never will. It <em>will<\/em>, however, authenticate to PAM, and PAM does have methods to authenticate to AD- mostly with winbind. Centrify is supposed to be the bridge between them, and<!--more--> much more reliable than using winbind, but as we discovered (quickly), Spacewalk&#8217;s documentation does not cover connecting to AD or winbind or anything similar. A quick google finds a few tutorials on how to connect to winbind, but none on Centrify.<\/p>\n<p><strong>Long story short:<\/strong> we did get AD working: and the trick was using system-auth instead of satellite-rhn for the rhn.conf file. Apparently Centrify adds some magic deep in the system-auth file ( \/etc\/pam.d\/system-auth ) that allows PAM to connect.<\/p>\n<p><strong>Long story long:<\/strong><\/p>\n<p>The tutorials we found on &#8220;the Google&#8221; were really trying their best to be helpful, but never quite got there.<\/p>\n<p>The default for Spacewalk is to set the contents of \/etc\/rhn\/rhn.conf \u00a0to<\/p>\n<pre>pam_auth_service = rhn-satellite<\/pre>\n<p>The default file is that rhn-satellite &#8211; \/etc\/pam.d\/rhn-satellite . If Spacewalk were authenticating to LDAP or NIS or whatever, that file would be correct. Granted, it&#8217;s just a short PAM tree, five or so lines of sufficient, requisite, etc.<\/p>\n<p>Further investigation reveals that Centrify needs to add a few lines, and change the others:<\/p>\n<p>Original rhn-satellite :<\/p>\n<pre>auth            required         pam_env.so\r\nauth<span style=\"color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; line-height: 21px;\">            sufficient       pam_sss.so<\/span>\r\nauth<span style=\"color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; line-height: 21px;\">            required         pam_deny.so<\/span>\r\naccount<span style=\"color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; line-height: 21px;\">         sufficient       pam_sss.so<\/span>\r\naccount<span style=\"color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; line-height: 21px;\">         required         pam_deny.so<\/span><\/pre>\n<p><span style=\"color: #222222;\"><span style=\"line-height: 21px;\">The suggested fix found on a few sites:<\/span><\/span><\/p>\n<pre>auth             required         pam_centrify.so\r\nauth             requisite        <span style=\"color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; line-height: 21px;\">pam_centrify.so  deny<\/span>\r\naccount          sufficient       pam_centrify.so\r\naccount          requisite        pam_centrify.so  deny\r\nsession          required         pam_centrify.so  homedir\r\npassword         sufficient       pam_centrify.so  try_first_pass\r\npassword         requisite        pam_centrify.so  deny<\/pre>\n<p><span style=\"color: #222222;\"><span style=\"line-height: 21px;\">On the surface, this looks like it&#8217;s correct, but we could never get it to work. <\/span><\/span><\/p>\n<p><span style=\"color: #222222;\"><span style=\"line-height: 21px;\">However, further searching had located some people who had made it work by just pointing line in rhn.conf to &#8220;password-auth&#8221; instead of &#8220;rhn-satellite&#8221;, since Centrify adds several extra lines to integrate with the specific AD domains there (which I won&#8217;t share for obvious security reasons). However, newer versions don&#8217;t have a &#8220;password-auth&#8221; file, and use &#8220;system-auth&#8221; instead. Making \/etc\/rhn\/rhn.conf read:<\/span><\/span><\/p>\n<pre><span style=\"color: #222222;\"><span style=\"line-height: 21px;\">pam_auth_service = system-auth<\/span><\/span><\/pre>\n<p><span style=\"color: #222222;\"><span style=\"line-height: 21px;\"> &#8230;finally did the trick. You&#8217;ll need to look at those files your self: password-auth and or system-auth to determine where the settings you need are: you can copy them to rhn-satellite, or simply point the pam_auth_service to it directly. The latter is what I did. <\/span><\/span><\/p>\n<p><span style=\"color: #222222;\"><span style=\"line-height: 21px;\">Hopefully this will help a few people out there!<\/span><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #222222;\"><span style=\"line-height: 21px;\">Bootnote: this should work both with Spacewalk and Satellite equally.<\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, I&#8217;ve been spending a good portion of the last six months designing a software distribution system, and looking for a good way to manage user access in an AD environment, where LDAP is fractured, at best. A few months ago, we were approved to procure Centrify as a provider of AD integration, so we &hellip; <a href=\"https:\/\/liniks.com\/?p=253\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Spacewalk, PAM, and Centrify&#8230;oh, my!<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,3,5],"tags":[26,25,23,20,24,17,21,22,18,28,27],"class_list":["post-253","post","type-post","status-publish","format-standard","hentry","category-geekdom","category-linux","category-tech","tag-active-directory","tag-ad","tag-centrify","tag-linux-2","tag-pam","tag-red-hat","tag-rh5","tag-rh6","tag-rhel","tag-satellite","tag-spacewalk"],"_links":{"self":[{"href":"https:\/\/liniks.com\/index.php?rest_route=\/wp\/v2\/posts\/253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/liniks.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/liniks.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/liniks.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/liniks.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=253"}],"version-history":[{"count":7,"href":"https:\/\/liniks.com\/index.php?rest_route=\/wp\/v2\/posts\/253\/revisions"}],"predecessor-version":[{"id":258,"href":"https:\/\/liniks.com\/index.php?rest_route=\/wp\/v2\/posts\/253\/revisions\/258"}],"wp:attachment":[{"href":"https:\/\/liniks.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/liniks.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/liniks.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}