<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>@Henning &#187; Linux</title>
	<atom:link href="http://www.eiben.weite-welt.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.eiben.weite-welt.com</link>
	<description>Yet another blog - surviving the internet</description>
	<lastBuildDate>Sun, 29 Jan 2012 16:37:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Adding a linux server to a windows domain</title>
		<link>http://www.eiben.weite-welt.com/2011/10/adding-a-linux-server-to-a-windows-domain/</link>
		<comments>http://www.eiben.weite-welt.com/2011/10/adding-a-linux-server-to-a-windows-domain/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 09:03:23 +0000</pubDate>
		<dc:creator>Henning Eiben</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Kerberos]]></category>
		<guid isPermaLink="false">http://www.eiben.weite-welt.com/?p=699</guid>
		<description><![CDATA[I already described in an earlier post how I added a linux server to a windows domain. Recently I added a new server to my domain, to replace my existing domain controller. As a consequence I had to update the krb5.conf file to point to the newly added server. Actually this hasn&#8217;t been to the [...]]]></description>
			<content:encoded><![CDATA[<p>I already described in an <a title="Einrichtung von winbind unter Debian" href="http://www.eiben.weite-welt.com/2006/03/winbind/">earlier post</a> how I added a linux server to a windows domain. Recently I added a new server to my domain, to replace my existing domain controller. As a consequence I had to update the <code>krb5.conf</code> file to point to the newly added server. Actually this hasn&#8217;t been to the first change in domain controllers, and usually users point out, that they cannot authenticate to subversion or apache based applications (which use kerberos authentication as well). OK, so I missed to update the <code>krb5.conf</code> again.</p>
<p>So there must be a more convenient way to configure kerberos. If only I had some way to pull the information of the current KDC from the domain-data. But wait &#8211; there is DNS. There are a couple of service-entries in DNS to point to all available kerberos servers in the domain! That sounds promising.</p>
<p>So I changed my <code>krb5.conf</code> file and added</p>
<pre class="brush:plain">dns_lookup_realm = yes
dns_lookup_kdc = yes</pre>
<p>to the <code>libdefaults</code> section. Then I removed the <code>realms</code> and <code>domain_realms</code> section. Now all information about available KDC servers is directly pulled from DNS &#8211; sweet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eiben.weite-welt.com/2011/10/adding-a-linux-server-to-a-windows-domain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrated Windows Authentication in Mantis (Updated to Mantis 1.2.1)</title>
		<link>http://www.eiben.weite-welt.com/2010/07/integrated-windows-authentication-in-mantis-updated-to-mantis-1-2-1/</link>
		<comments>http://www.eiben.weite-welt.com/2010/07/integrated-windows-authentication-in-mantis-updated-to-mantis-1-2-1/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 08:47:19 +0000</pubDate>
		<dc:creator>Henning Eiben</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mantis]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">http://www.eiben.weite-welt.com/?p=518</guid>
		<description><![CDATA[In a previous post I described the necessary steps, to enable integrated windows authentication when working with Mantis on a linux box. These modifications where targeted against the 1.1.0a2 release of Mantis. In the meantime a lot of development has been done on Mantis, so that my original post isn&#8217;t quite accurate anymore. This post [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous <a href="/2007/04/mantis_iwa/">post</a> I described the necessary steps, to enable integrated windows authentication when working with <a href="http://www.mantisbt.org/">Mantis</a> on a linux box. These modifications where targeted against the 1.1.0a2 release of Mantis. In the meantime a lot of development has been done on Mantis, so that my original post isn&#8217;t quite accurate anymore. This post will enable you to use integrated security with the current 1.2.1 release of Mantis.</p>
<p>While the basic setup is somewhat unchanged, only the file <code>core/authentication_api.php</code> needs to be changed. The <code>login.php</code> doesn&#8217;t need to be changed anymore, since the  functionallity moved to the <code>authentication_api.php</code>.</p>
<p>I added an updated <a title="iwa_sso2.zip" href="http://www.eiben.weite-welt.com/wp-content/uploads/2010/07/iwa_sso2.zip">patchfile</a> to apply the necessary changes to the file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eiben.weite-welt.com/2010/07/integrated-windows-authentication-in-mantis-updated-to-mantis-1-2-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrated Windows Authentication in Mantis</title>
		<link>http://www.eiben.weite-welt.com/2007/04/mantis_iwa/</link>
		<comments>http://www.eiben.weite-welt.com/2007/04/mantis_iwa/#comments</comments>
		<pubDate>Tue, 17 Apr 2007 13:16:22 +0000</pubDate>
		<dc:creator>Henning Eiben</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mantis]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">http://blog.eiben.weite-welt.com/?p=249</guid>
		<description><![CDATA[This article shows how to modifiy Mantis Bug Tracker running on Linux to allow SSO-like authentication using Integrated Windows Authentication]]></description>
			<content:encoded><![CDATA[<div>
<p><strong>Update: a new <a href="/2010/07/integrated-windows-authentication-in-mantis-updated-to-mantis-1-2-1/">post</a> is availbe, with an updates patchfile for Mantis 1.2.1!</strong></p>
<p>The more tools are being used in an enterprise  environment, the more logins and passwords need to be memorized. A first  step is to use LDAP based authenticatin. In MS Windows based networks  this offers to ability to manage all users in the Active Directory, so  the users only have to use on username/password. But the user will still  have to enter this into a login-screen in order to access the  application.</p>
<p>Using SSO the user is always identified by already existind  credentials. In the best case, the logon credetials of the operating  system are being used. Since Active Directory is based on the Kereberos  authentication protocoll, this offers the ability to use kerberos based  authentication in other applications, and thus re-using the existing  windows authentication.</p>
<p>The Internet Explorer is capable of using the windws  logon-credentials to authenticate users on certain webservers. But with a  slight modification this can also be used on an Apache running on a  linux box. How to <a href="apache_kerberos">setup  Apache to allow kerberos authentication</a> is explained in another  article. Once Apache is setup correct, Mantis needs to be slightly  modified to use the information supplied by the kerberos authentication.  My modifications are all based on the current development-release of  mantis <span><a href="http://sourceforge.net/project/showfiles.php?group_id=14963&amp;package_id=12175&amp;release_id=469627">1.1.0a2</a></span>.</p>
<h2>Modifing Mantis</h2>
<p>Basically three files need to be modified: <code>core\authentication_api.php</code>,  <code>login.php</code> and <code>config.inc.php</code>.</p>
<ol>
<li>In <code>config.inc.php</code> I switch from LDAP  authentication to HTTP_AUTH, since I wand the webserver to handle the  authentication. Also I introduce a new configuration setting <code>sso_user_regex</code>.  This is needed, because I need to extract the username from the user  identified by the webserver. So I use this handy little regex to do this  for me:
<pre class="brush:php">         $g_login_method    = HTTP_AUTH;
         $g_sso_user_regex  = '/^(.*)@ACME\.COM$/i';</pre>
<p>This regex would extract the username portion for users of the  domain &#8220;ACME.COM&#8221;.</li>
<li> Next would be to modify <code>login.php</code> to extract the  username from the authenticated user, if the user was detected using  &#8220;Negotiation&#8221; (which is the case if IWA was used). So I apply my  previously defined regex to the &#8220;Remote-User&#8221; variable of the server to  get my mantis username. So we have to insert some code at line 32:
<pre class="brush:php">      if ( isset($_SERVER['REMOTE_USER'])) { #  $_SERVER['AUTH_TYPE'] == 'Negotiate' )
        preg_match(config_get('sso_user_regex'), $_SERVER['REMOTE_USER'], $user_match);
        $f_username = $user_match[1];
      }</pre>
</li>
<li> The last step is to add an additional condition to the <code>authentication_api.php</code> to prevent from trying to authenticate the user with the mantis user  database using the username and password. This would only work, if the  username and password would be supplied by the webserver, but using IWA  we only have the username (the password is not transmitted in IWA, only  the logon-challange). So this would only work if Basic Authentication  would be used instead of kerberos authentication. So validating username  and password with the mantis user database is restricted for <code>HTTP_AUTH</code> by modifing line 121:
<pre class="brush:php">      if ( HTTP_AUTH != $t_login_method &amp;&amp; !auth_does_password_match( $t_user_id, $p_password ) ) {
      # if ( !auth_does_password_match( $t_user_id, $p_password ) ) {</pre>
</li>
</ol>
<p>So this should be all, to get Integrated Windows Authentication  running. Below is a patchfile to apply the changes of <code>authentication_api.php</code> and <code>login.php</code>.</p>
<p>Attached you&#8217;ll find a patch-file to modified the corresponding  files. To apply the patch you simple need to execute (assuming you have  patch, and you&#8217;re executing it within your install-directory of Mantis):</p>
<pre class="brush:plain">   patch &lt; iwa_sso.patch -p0</pre>
<p>Download: <a href="http://www.eiben.weite-welt.com/wp-content/uploads/2009/12/iwa_sso.zip">iwa_sso patch</a></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.eiben.weite-welt.com/2007/04/mantis_iwa/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Kerberos authentication in Apache</title>
		<link>http://www.eiben.weite-welt.com/2007/03/apache_kerberos/</link>
		<comments>http://www.eiben.weite-welt.com/2007/03/apache_kerberos/#comments</comments>
		<pubDate>Sat, 17 Mar 2007 13:16:34 +0000</pubDate>
		<dc:creator>Henning Eiben</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Kerberos]]></category>
		<guid isPermaLink="false">http://blog.eiben.weite-welt.com/?p=260</guid>
		<description><![CDATA[Using kerberos based authentication in Apache enables Apache to authenticated users for e.g. against Windows Active Directory]]></description>
			<content:encoded><![CDATA[<div>
<p>First of all the <code>mod_auth_kerb</code> is needed to  add kerberos capabilities to Apache. Besides this a working  configuration of kerberos 5 is needed on the server running Apache.</p>
<h2>Prepare Active Directoy</h2>
<ol>
<li> To enable authentication against Active Directory a dedicated user  is needed for each Apache server. The password doesn&#8217;t really matter,  but the username should use a certain convention and maybe a explaining  description. Such a account could be <code>http-linuxserver</code>.</li>
<li> For the newly created account a keytab is needed to use the  account from Apache. To create such a keytab the <code>ktpass.exe</code> is needed. The command on a Server running Windows 2003 looks like  this:
<pre class="brush:plain">         ktpass.exe -princ HTTP/linuxserver@ACME.COM
         -mapuser http-linuxserver
         -crypto DES-CBC-MD5 +DesOnly
         -pass myverygoodpass
         -ptype KRB5_NT_PRINCIPAL
         -out linuxxserver.keytab</pre>
<p>For domain-controllers running Windows 2000 the command might be slightly different.</li>
</ol>
<h2>Configuring Apache</h2>
<p>After installing the <code>mod_auth_kerb</code> a couple  configuration settings need to be made.</p>
<ol>
<li> First the previously created keytab file needs to be copied to the  server (prefferedly using scp or simillar).</li>
<li> Change to owner of the keytab-file to the user running Apache  (depending on your distribution that could be <code>apache</code>, <code>www-data</code> or something else).</li>
<li> To secure a directory or using kerberos the following entries need  to be added to the appropriate configuration section of apache:
<pre class="brush:plain">    AuthType Kerberos
    AuthName "Kerberos Login"
    KrbServiceName HTTP
    KrbMethodK5Passwd On
    KrbAuthRealms ACME.COM
    Krb5KeyTab /etc/httpd/conf/linuxserver.keytab
    require valid-user</pre>
</li>
<li> Restart Apache to apply the changes.</li>
</ol>
<p>If you now access the secured website using Internet Explorer that  supports Integrated Windows Authentication, you can see the content  without being prompted for a password as long as you have valid  windows-credentials.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.eiben.weite-welt.com/2007/03/apache_kerberos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programme ausserhalb des Suchpfads bequem starten</title>
		<link>http://www.eiben.weite-welt.com/2006/10/hash/</link>
		<comments>http://www.eiben.weite-welt.com/2006/10/hash/#comments</comments>
		<pubDate>Sat, 14 Oct 2006 18:05:22 +0000</pubDate>
		<dc:creator>Henning Eiben</dc:creator>
				<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">http://www.eiben.weite-welt.com/?p=425</guid>
		<description><![CDATA[Unter Linux können Programme aushalb des Suchpfades bequem gestartet werden]]></description>
			<content:encoded><![CDATA[<p>Angenommen, Sie haben in /home/ichselber/test/ das Programm fiesesskript.sh liegen und wollen nicht bei jedem Start des Programms den Pfad komplett eingeben: Wenn Sie das Programm nicht in den Suchpfad mit aufnehmen wollen, liegt die Loesung in dem Befehl hash:</p>
<pre class="brush:bash;"> hash -p /pfad/zu/meinem/programm/programm kurzname</pre>
<p>Anhand unseres Beispiels sieht das so aus:</p>
<pre class="brush:bash;"> hash -p /home/ichselber/test/fiessesskript.sh fies</pre>
<p>Mit diesem Befehl bewirken Sie, dass ab jetzt die Eingabe <code>fies</code> reicht. Wenn Sie nur <code>hash</code> eingeben, bekommen Sie die Liste der bereits gespeicherten Kommandos angezeigt. Mit dem Befehl <code>hash -r</code> wird die Liste geleert.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eiben.weite-welt.com/2006/10/hash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Einrichtung von winbind unter Debian</title>
		<link>http://www.eiben.weite-welt.com/2006/03/winbind/</link>
		<comments>http://www.eiben.weite-welt.com/2006/03/winbind/#comments</comments>
		<pubDate>Fri, 24 Mar 2006 11:51:45 +0000</pubDate>
		<dc:creator>Henning Eiben</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Samba]]></category>
		<guid isPermaLink="false">http://www.eiben.weite-welt.com/?p=308</guid>
		<description><![CDATA[Winbind ermöglicht die Integration von Linux in eine bestehende Active Directory Struktur. Somit können User aus einer Windows-Domäne via Kerberos authentifiziert werden. Das hilft nicht nur bei Samba, sondern somit können User einheitlich und Betriebssystempbergreifend verwaltet werden.]]></description>
			<content:encoded><![CDATA[<p>Im folgenden wir beschrieben, wie <code>winbind</code> unter Debian eingerichtet werden muss, damit User ab Samba 3.x durch Active Directory authentifiziert werden können. In weiteren Schritten können sich User auch direkt an einem Linux-Terminal anmelden, deren Accounts lediglich im Active Directory vorhanden sind.</p>
<h2>Voraussetzungen</h2>
<p>Folgende Packages sollten installiert sein:</p>
<ul>
<li>winbind</li>
<li>samba</li>
<li>libkrb53</li>
<li>krb5-user</li>
</ul>
<p>Bei der Installation von krb5-conf werden ein paar Informationen direkt abgefragt, wie etwas der Default Realm (entspricht dem Namen der Active Directory Domäne) und des Domänenservers. Anschließend sollte allerdings die Datei <code>/etc/krb5.conf</code> noch ein wenig bearbeitet werden. Soll Kerberos nur für in Zusammenhang mit Winbind eingesetzt werden, so können die ganzen MIT-Realms ersteinmal entfernt werden. Auch werden eine ganze Reihe von Einstellungen für Kerberos 4 nicht benötigt; auch diese können weg.</p>
<p>Eine einfache <code>krb5.conf</code> Datei für die Domäne ACME.COM (aka Realm) könnte also so aussehen:</p>
<pre class="brush:plain"> [libdefaults]
        default_realm = ACME.COM
        kdc_timesync = 1
        ccache_type = 4
        forwardable = true
        proxiable = true
 [realms]
 ACME.COM = {
        kdc = server.acme.com
        admin_server = server.acme.com
 }
 [domain_realm]
        acme.com = ACME.COM
        .acme.com = ACME.COM</pre>
<p>Damit die Benutzerauflösung auch durch Winbind erfolgen kann, muss zum einen in der <code>nsswitch.conf</code>neben <code>compat</code> auch <code>windbind</code> eingetragen werden (auf diese Weise werden sowohl lokale Benutzer als auch Benutzer über Winbind zur Verfügung gestellt) und Samba muss noch so eingestellt werden, daß die Authentifizierung über das ADS läuft. Eine einfach <code>smb.conf</code> sieht dann etwa so aus:</p>
<pre class="brush:plain"> # Global parameters
 [global]
        workgroup = ACME
        realm = ACME.COM
        idmap uid = 10000-20000
        idmap gid = 10000-20000
        winbind separator = /
        winbind use default domain = yes
        server string = %h server (Samba %v)
        security = ADS
        password server = server.acme.com
        client use spnego = yes</pre>
<p>Damit die Änderungen übernommen werden, muss sowohl Samba als auch Winbind neu gestartet werden (<code>/etc/init.d/samba restart; /etc/init.d/winbind restart</code>). Anschließend kann mit <code>wbinfo -u</code> eine Liste alle Benutzer über winbind angezeigt werden.</p>
<p>Nun sollten sich auch Windows-Benutzer, die auf dem Linux Rechner nicht lokal angelegt sind, auf Samba-Freigaben verbinden können. Die Authentifizierung wird im Hintergrund durch Winbind erledgit.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eiben.weite-welt.com/2006/03/winbind/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

