<?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>Ohjeah! &#187; Linux</title>
	<atom:link href="http://www.ohjeah.net/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ohjeah.net</link>
	<description>The writings of JRO...</description>
	<lastBuildDate>Thu, 09 Jun 2011 19:07:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Linux SSH + PAM + LDAP + SSSD+ 2008 R2 AD Deployment</title>
		<link>http://www.ohjeah.net/2011/06/09/linux-ssh-pam-ldap-sssd-2008-r2-ad-deployment/</link>
		<comments>http://www.ohjeah.net/2011/06/09/linux-ssh-pam-ldap-sssd-2008-r2-ad-deployment/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 18:58:17 +0000</pubDate>
		<dc:creator>jro</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[pam]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sssd]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.ohjeah.net/?p=277</guid>
		<description><![CDATA[As an update to my previous post &#8220;Linux SSH + PAM + LDAP + 2003 R2 AD Deployment&#8220;, SSSD is now part of the base RHEL6 repository (soon CentOS6 as well) which makes it much faster and easier to implement LDAP/AD authentication.  In regards to configuring Active Directory, not too much has changed since my [...]]]></description>
			<content:encoded><![CDATA[<p>As an update to my previous post &#8220;<a href="http://www.ohjeah.net/2008/09/23/linux-ssh-pam-ldap-2003-r2-ad-deployment/">Linux SSH + PAM + LDAP + 2003 R2 AD Deployment</a>&#8220;, <a href="https://fedorahosted.org/sssd/">SSSD</a> is now part of the base RHEL6 repository (soon CentOS6 as well) which makes it much faster and easier to implement LDAP/AD authentication.  In regards to configuring Active Directory, not too much has changed since my previous post so you&#8217;ll need to hit up the previous guide for a complete guide.  So lets get to it..</p>
<p><span id="more-277"></span></p>
<p><strong>Installing and Configuring PAM/LDAP/SSSD (tested on RHEL6):</strong></p>
<p>Get some base packages:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># yum install openldap pam pam_ldap pam_krb5 ntp sssd</span></pre></div></div>

<p>Configure /etc/sssd/sssd.conf (make sure you update  ldap_default_authtok to your LDAP/AD user password).  If you recreate sssd.conf be sure to   chmod 600 or the service will fail to start:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># vi /etc/sssd/sssd.conf</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>sssd<span style="color: #7a0874; font-weight: bold;">&#93;</span>
domains = LDAP
services = nss, pam
config_file_version = <span style="color: #000000;">2</span>
sbus_timeout = <span style="color: #000000;">30</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>nss<span style="color: #7a0874; font-weight: bold;">&#93;</span>
filter_groups = root
filter_users = root
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>pam<span style="color: #7a0874; font-weight: bold;">&#93;</span>
offline_credentials_expiration = <span style="color: #000000;">0</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>domain<span style="color: #000000; font-weight: bold;">/</span>LDAP<span style="color: #7a0874; font-weight: bold;">&#93;</span>
description = LDAP domain with AD server
debug_level = <span style="color: #000000;">9</span>
enumerate = <span style="color: #c20cb9; font-weight: bold;">false</span>
min_id = <span style="color: #000000;">1000</span>
&nbsp;
access_provider = ldap
<span style="color: #666666; font-style: italic;"># Restrict access to a certain group, update or comment this out</span>
ldap_access_filter = <span style="color: #007800;">memberOf</span>=<span style="color: #007800;">cn</span>=LinuxUsers,<span style="color: #007800;">ou</span>=Groups,<span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">dc</span></span>=domain,<span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">dc</span></span>=com
&nbsp;
id_provider = ldap
chpass_provider = krb5
&nbsp;
ldap_uri = ldap:<span style="color: #000000; font-weight: bold;">//</span>dc1.domain.com, ldap:<span style="color: #000000; font-weight: bold;">//</span>dc2.domain.com
ldap_search_base = <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">dc</span></span>=domain,<span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">dc</span></span>=com
&nbsp;
tls_reqcert = demand
ldap_tls_cacert = <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>pki<span style="color: #000000; font-weight: bold;">/</span>tls<span style="color: #000000; font-weight: bold;">/</span>certs<span style="color: #000000; font-weight: bold;">/</span>ca-bundle.crt
ldap_tls_cacertdir = <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>pki<span style="color: #000000; font-weight: bold;">/</span>tls<span style="color: #000000; font-weight: bold;">/</span>certs
&nbsp;
<span style="color: #666666; font-style: italic;"># User that can read from AD, any normal user should work.  Update as necessary</span>
ldap_default_bind_dn = <span style="color: #007800;">cn</span>=ldapuser,<span style="color: #007800;">ou</span>=Users,<span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">dc</span></span>=domain,<span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">dc</span></span>=com
&nbsp;
<span style="color: #666666; font-style: italic;"># Leave this as password</span>
ldap_default_authtok_type = password
&nbsp;
<span style="color: #666666; font-style: italic;"># The ldap users actual password, update as necessary</span>
ldap_default_authtok = ldapusers_password
&nbsp;
ldap_tls_cacert = <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>pki<span style="color: #000000; font-weight: bold;">/</span>tls<span style="color: #000000; font-weight: bold;">/</span>certs<span style="color: #000000; font-weight: bold;">/</span>ca-bundle.crt
ldap_tls_cacertdir = <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>pki<span style="color: #000000; font-weight: bold;">/</span>tls<span style="color: #000000; font-weight: bold;">/</span>certs
ldap_schema = rfc2307bis
ldap_user_principal = userPrincipalName
ldap_user_fullname = displayName
ldap_user_name = sAMAccountName
ldap_user_object_class = user
ldap_user_home_directory = unixHomeDirectory
ldap_user_shell = msSFU30LoginShell
ldap_user_principal = userPrincipalName
ldap_group_object_class = group
ldap_force_upper_case_realm = True
&nbsp;
<span style="color: #666666; font-style: italic;"># kerberos config</span>
auth_provider = krb5
krb5_server = dc1.domain.com, dc2.domain.com
krb5_realm = DOMAIN.COM
krb5_changepw_principle = kadmin<span style="color: #000000; font-weight: bold;">/</span>changepw
krb5_ccachedir = <span style="color: #000000; font-weight: bold;">/</span>tmp
krb5_ccname_template = FILE:<span style="color: #000000; font-weight: bold;">%</span>d<span style="color: #000000; font-weight: bold;">/</span>krb5cc_<span style="color: #000000; font-weight: bold;">%</span>U_XXXXXX
krb5_auth_timeout = <span style="color: #000000;">15</span>
cache_credentials = True</pre></div></div>

<p>Configure /etc/krb5.conf:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># vi /etc/krb5.conf</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>logging<span style="color: #7a0874; font-weight: bold;">&#93;</span>
 default = FILE:<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>krb5libs.log
 kdc = FILE:<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>krb5kdc.log
 admin_server = FILE:<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>kadmind.log
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>libdefaults<span style="color: #7a0874; font-weight: bold;">&#93;</span>
 default_realm = DOMAIN.COM
 dns_lookup_realm = <span style="color: #c20cb9; font-weight: bold;">true</span>
 dns_lookup_kdc = <span style="color: #c20cb9; font-weight: bold;">true</span>
 ticket_lifetime = 24h
 forwardable = <span style="color: #c20cb9; font-weight: bold;">yes</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>realms<span style="color: #7a0874; font-weight: bold;">&#93;</span>
 KEMPERVALVE.COM = <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  kdc = dc1.domain.com
  kdc = dc2.domain.com
 <span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>domain_realm<span style="color: #7a0874; font-weight: bold;">&#93;</span>
 .DOMAIN.COM = DOMAIN.COM
 DOMAIN.COM = DOMAIN.COM
&nbsp;
 domain.com = DOMAIN.COM
 .domain.com = DOMAIN.COM
<span style="color: #7a0874; font-weight: bold;">&#91;</span>appdefaults<span style="color: #7a0874; font-weight: bold;">&#93;</span>
 pam = <span style="color: #7a0874; font-weight: bold;">&#123;</span>
   debug = <span style="color: #c20cb9; font-weight: bold;">false</span>
   ticket_lifetime = <span style="color: #000000;">36000</span>
   renew_lifetime = <span style="color: #000000;">36000</span>
   forwardable = <span style="color: #c20cb9; font-weight: bold;">true</span>
   krb4_convert = <span style="color: #c20cb9; font-weight: bold;">false</span>
 <span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p>Update authentication methods (if authconfig is unavailable you&#8217;ll have to manual edit the order in /etc/pam.d/password-auth):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># authconfig --enablemkhomedir --enablesssdauth --updateall</span></pre></div></div>

<p>Verify nsswitch.conf was updated with sss:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># vi /etc/nsswitch.conf</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">passwd</span>:     files sss
shadow:     files sss
group:      files sss</pre></div></div>

<p>Enable SSSD on boot, start if necessary (should be running already):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># chkconfig sssd on</span>
<span style="color: #666666; font-style: italic;"># /etc/rc.d/init.d/sssd start</span></pre></div></div>

<p><em><span style="text-decoration: underline;">Giving SUDO permissions</span></em> (Optional) Add the group you configured in AD to your sudoers file using %groupname (case sensitive). Example:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># vi /etc/sudoers</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Give our Windows Group linuxusers (system admins), ALL commands.</span>
<span style="color: #000000; font-weight: bold;">%</span>LinuxUsers     <span style="color: #007800;">ALL</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span>ALL<span style="color: #7a0874; font-weight: bold;">&#41;</span>       ALL</pre></div></div>

<p>Test AD authentication and that the users home directory was created (/home/username).  Be sure to add ntpdate to a cron job to keep the time in sync with your domain controller.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ohjeah.net/2011/06/09/linux-ssh-pam-ldap-sssd-2008-r2-ad-deployment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Update Password Script</title>
		<link>http://www.ohjeah.net/2009/03/04/linux-update-password-script/</link>
		<comments>http://www.ohjeah.net/2009/03/04/linux-update-password-script/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 15:51:47 +0000</pubDate>
		<dc:creator>jro</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://www.ohjeah.net/?p=199</guid>
		<description><![CDATA[In my last post I showed a good example for using expect in a script.  Here is another good example I use for updating local user passwords across a group of servers without using ssh keys.  This assumes the user you are resetting can ssh to the host and the old password is the same [...]]]></description>
			<content:encoded><![CDATA[<p>In my last post I showed a good example for using expect in a script.  Here is another good example I use for updating local user passwords across a group of servers without using ssh keys.  This assumes the user you are resetting can ssh to the host and the old password is the same on all hosts.</p>
<p><span id="more-199"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #666666; font-style: italic;"># $Id: password_change.sh 6 2009-03-09 18:57:02Z jaredo $</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Copyright (c) 2009 Jared Orzechowski &amp;lt;jaredo at ameritech dot net&amp;gt;</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Description:  This script will ssh to servers and change the specified</span>
<span style="color: #666666; font-style: italic;"># users password (assuming user can ssh).  Requires expect package.</span>
&nbsp;
<span style="color: #007800;">USER</span>=<span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #007800;">OLDPW</span>=<span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #007800;">NEWPW</span>=<span style="color: #ff0000;">&quot;&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> resetpw<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
          <span style="color: #7a0874; font-weight: bold;">echo</span>
          <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Attempting to reset password for <span style="color: #007800;">$USER</span> on host $1..&quot;</span>
&nbsp;
              <span style="color: #007800;">CMD</span>=<span style="color: #ff0000;">&quot;ssh -l root $1 passwd <span style="color: #007800;">$USER</span>&quot;</span>
              expect <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;
              match_max 100000
              spawn <span style="color: #007800;">$CMD</span>
&nbsp;
              expect {
                <span style="color: #000099; font-weight: bold;">\&quot;</span>Are you sure you want to continue connecting (yes/no)?<span style="color: #000099; font-weight: bold;">\&quot;</span> {
                send <span style="color: #000099; font-weight: bold;">\&quot;</span>yes<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\&quot;</span>
                exp_continue
                }
                <span style="color: #000099; font-weight: bold;">\&quot;</span>s password:<span style="color: #000099; font-weight: bold;">\&quot;</span> {
                send <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">$OLDPW</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\&quot;</span>
                exp_continue
                }
                <span style="color: #000099; font-weight: bold;">\&quot;</span>UNIX password:<span style="color: #000099; font-weight: bold;">\&quot;</span> {
                send <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">$NEWPW</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\&quot;</span>
                exp_continue
                expect -re <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">$USER</span>*<span style="color: #000099; font-weight: bold;">\&quot;</span>
                }
              }
              &quot;</span>
        <span style="color: #000000; font-weight: bold;">else</span>
          <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Missing hostname..&quot;</span>
        <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Syntax: resetpw hostname</span>
<span style="color: #666666; font-style: italic;">#Example:</span>
resetpw myserver1
resetpw myserver2
resetpw myserver3
resetpw myserver4</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.ohjeah.net/2009/03/04/linux-update-password-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remote Server Shutdown</title>
		<link>http://www.ohjeah.net/2009/03/03/remoe-server-shutdown/</link>
		<comments>http://www.ohjeah.net/2009/03/03/remoe-server-shutdown/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 17:34:08 +0000</pubDate>
		<dc:creator>jro</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[shutdown]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.ohjeah.net/?p=188</guid>
		<description><![CDATA[One of my recent projects was to initiate a server-wide shutdown should our UPS ever run low.  I currently have Zenoss monitoring the health status of the UPS, including the remaining charge on the battery.  Using Zenoss thresholds, I can make a script execute if the battery ever runs low.
Our Zenoss deployment currently runs on [...]]]></description>
			<content:encoded><![CDATA[<p>One of my recent projects was to initiate a server-wide shutdown should our UPS ever run low.  I currently have Zenoss monitoring the health status of the UPS, including the remaining charge on the battery.  Using Zenoss thresholds, I can make a script execute if the battery ever runs low.</p>
<p>Our Zenoss deployment currently runs on CentOS, so I put down a method to shut down each type of host from a linux platform.  After much researching and testing, this is what I came up with (and am currently using in my shutdown script).</p>
<p><strong>For Windows:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">net rpc SHUTDOWN <span style="color: #660033;">-C</span> <span style="color: #ff0000;">&quot;Automated shutdown&quot;</span> <span style="color: #660033;">-f</span> <span style="color: #660033;">-I</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$server</span>&quot;</span> <span style="color: #660033;">-W</span> <span style="color: #007800;">$domain</span> <span style="color: #660033;">-U</span> <span style="color: #007800;">$username</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #007800;">$password</span></pre></div></div>

<p>I replaced my arguments with some that would be more readable.  User and password are separated with %.</p>
<p><strong>For Linux:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">CMD</span>=<span style="color: #ff0000;">&quot;ssh -l <span style="color: #007800;">$username</span> <span style="color: #007800;">$server</span> shutdown -h now&quot;</span>
              expect <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;
              match_max 100000
              spawn <span style="color: #007800;">$CMD</span>
&nbsp;
              expect {
                <span style="color: #000099; font-weight: bold;">\&quot;</span>Are you sure you want to continue connecting (yes/no)?<span style="color: #000099; font-weight: bold;">\&quot;</span> {
                send <span style="color: #000099; font-weight: bold;">\&quot;</span>yes<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\&quot;</span>
                exp_continue
                }
                <span style="color: #000099; font-weight: bold;">\&quot;</span>password:<span style="color: #000099; font-weight: bold;">\&quot;</span> {
                send <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">$password</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\&quot;</span>
                expect -re <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">$username</span>*<span style="color: #000099; font-weight: bold;">\&quot;</span>
                }
              }
              &quot;</span></pre></div></div>

<p>I wanted to shutdown linux servers without using keys but had to overcome the &#8220;do you want to connect&#8221; prompt.  In order to do that I had to use exact which can be installed with &#8220;yum install exact&#8221;</p>
<p>By turning these into functions and passing arguments, you can make a shutdown script in a couple of minutes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ohjeah.net/2009/03/03/remoe-server-shutdown/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Kernel Caching in Action</title>
		<link>http://www.ohjeah.net/2008/12/09/kernel-caching-in-action/</link>
		<comments>http://www.ohjeah.net/2008/12/09/kernel-caching-in-action/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 15:58:18 +0000</pubDate>
		<dc:creator>jro</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[memory]]></category>

		<guid isPermaLink="false">http://www.ohjeah.net/?p=124</guid>
		<description><![CDATA[
&#91;jaredo@zim ~&#93;$ cat /proc/meminfo
MemTotal:     32962112 kB
MemFree:        237376 kB
Buffers:        235768 kB
Cached:       20340388 kB

Monitoring after a recent reboot:

]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>jaredo<span style="color: #000000; font-weight: bold;">@</span>zim ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>meminfo
MemTotal:     <span style="color: #000000;">32962112</span> kB
MemFree:        <span style="color: #000000;">237376</span> kB
Buffers:        <span style="color: #000000;">235768</span> kB
Cached:       <span style="color: #000000;">20340388</span> kB</pre></div></div>

<p>Monitoring after a recent reboot:</p>
<p><a href="http://www.ohjeah.net/wp-content/uploads/2008/12/kernel_mem_usage.png" rel="shadowbox[post-124];player=img;"><img class="alignnone size-medium wp-image-125" title="kernel_mem_usage" src="http://www.ohjeah.net/wp-content/uploads/2008/12/kernel_mem_usage-300x92.png" alt="" width="300" height="92" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ohjeah.net/2008/12/09/kernel-caching-in-action/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Apache + Subversion + Active Directory Authentication</title>
		<link>http://www.ohjeah.net/2008/10/03/linux-apache-subversion-active-directory-authentication/</link>
		<comments>http://www.ohjeah.net/2008/10/03/linux-apache-subversion-active-directory-authentication/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 20:21:34 +0000</pubDate>
		<dc:creator>jro</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[AD]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.ohjeah.net/?p=66</guid>
		<description><![CDATA[I found Subversion (svn) over HTTP to be very easy to deploy on top of our existing setup, and only took about 15 minutes.  It simplifies user management by allowing us to manage users through Active Directory, and makes it easier on staff by using URLs for access.  Here is a quick demonstration on a [...]]]></description>
			<content:encoded><![CDATA[<p>I found Subversion (svn) over HTTP to be very easy to deploy on top of our existing setup, and only took about 15 minutes.  It simplifies user management by allowing us to manage users through Active Directory, and makes it easier on staff by using URLs for access.  Here is a quick demonstration on a Fedora 9 box, assuming you have already performed a basic or default apache install.<span id="more-66"></span></p>
<p><strong>Requirements: </strong></p>
<p>Install the necessary svn packages:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># yum install subversion mod_dav_svn</span></pre></div></div>

<p><strong>Configure AD:</strong></p>
<p>Create a user to bind to, this user needs no special permissions.  I used <strong>svnuser</strong> in this demonstration.</p>
<p>Create a security group, users will need to be a member of this group in order to access our repositories.  I used <strong>SVN_Access</strong> in this demonstration.</p>
<p><strong>Create Repositories:</strong></p>
<p>Create the following directories in your http root if you have not done so (/var/www on most systems):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># mkdir /var/www/svn</span>
<span style="color: #666666; font-style: italic;"># mkdir /var/www/svn/repos</span></pre></div></div>

<p>This will be the location for all of our repositories.  Now to create a repository (test in this example):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># svnadmin create /var/www/svn/repos/test</span></pre></div></div>

<p>Grant apache access to the repository:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># chown -R apache.apache /var/www/svn/repos/test</span></pre></div></div>

<p><strong>Configure Apache:</strong></p>
<p>Create an httpd/apache include file for our subversion configuration, this may have already been created for you.  Depending on your distro, you may need to integrate this directly in to your httpd.conf:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># touch /etc/httpd/conf.d/subversion.conf</span></pre></div></div>

<p>Example subversion.conf:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">LoadModule dav_svn_module     modules<span style="color: #000000; font-weight: bold;">/</span>mod_dav_svn.so
LoadModule authz_svn_module   modules<span style="color: #000000; font-weight: bold;">/</span>mod_authz_svn.so
&nbsp;
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Example configuration to enable HTTP access for a directory</span>
<span style="color: #666666; font-style: italic;"># containing Subversion repositories, &quot;/var/www/svn&quot;.  Each repository</span>
<span style="color: #666666; font-style: italic;"># must be readable and writable by the 'apache' user.  Note that if</span>
<span style="color: #666666; font-style: italic;"># SELinux is enabled, the repositories must be labelled with a context</span>
<span style="color: #666666; font-style: italic;"># which httpd can write to; this will happen by default for</span>
<span style="color: #666666; font-style: italic;"># directories created in /var/www.  Use &quot;restorecon -R /var/www/svn&quot;</span>
<span style="color: #666666; font-style: italic;"># to label the repositories if upgrading from a previous release.</span>
<span style="color: #666666; font-style: italic;">#</span>
&nbsp;
   DAV <span style="color: #c20cb9; font-weight: bold;">svn</span>
   SVNParentPath <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>repos
   SVNListParentPath on
&nbsp;
      order allow,deny
      allow from all
      Options Indexes
      AuthzLDAPAuthoritative On
&nbsp;
      AuthName <span style="color: #ff0000;">&quot;My Repository&quot;</span>
      AuthType Basic
      AuthBasicProvider ldap
&nbsp;
      AuthLDAPBindDN svnuser<span style="color: #000000; font-weight: bold;">@</span>domain.com
      AuthLDAPBindPassword Test123
&nbsp;
      AuthLDAPURL <span style="color: #ff0000;">&quot;ldap://dc.domain.com:3268/dc=domain,dc=com?sAMAccountName?sub?(objectCategory=person)&quot;</span>
      Require ldap-group <span style="color: #007800;">CN</span>=SVN_Access,<span style="color: #007800;">OU</span>=Groups,<span style="color: #007800;">DC</span>=domain,<span style="color: #007800;">DC</span>=com
&nbsp;
      REQUIRE valid-user</pre></div></div>

<p>You should now be able to access your test repository at <a href="http://website/repos/test">http://website/repos/test</a> <img src='http://www.ohjeah.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ohjeah.net/2008/10/03/linux-apache-subversion-active-directory-authentication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PXE and Kickstart, Automated Installations for Linux via WDS</title>
		<link>http://www.ohjeah.net/2008/09/24/pxe-and-kickstart-automated-installations-for-linux-via-wds/</link>
		<comments>http://www.ohjeah.net/2008/09/24/pxe-and-kickstart-automated-installations-for-linux-via-wds/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 01:18:51 +0000</pubDate>
		<dc:creator>jro</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[kickstart]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[pxe]]></category>
		<category><![CDATA[wds]]></category>

		<guid isPermaLink="false">http://nativemo.de/?p=50</guid>
		<description><![CDATA[Today I decided to setup automated installations for Linux distros (RHEL, Fedora, CentOS), similar to how we deploy our Windows installations via PXE.  Since we already had WDS running for installing Windows, it was just a matter of reconfiguring WDS, setting up the necessary structure and kickstart files for our automated Linux installations.  While I do not cover [...]]]></description>
			<content:encoded><![CDATA[<p>Today I decided to setup automated installations for Linux distros (RHEL, Fedora, CentOS), similar to how we deploy our Windows installations via <a href="http://en.wikipedia.org/wiki/Preboot_Execution_Environment" target="_blank">PXE</a>.  Since we already had <a href="http://en.wikipedia.org/wiki/Windows_Deployment_Services">WDS</a> running for installing Windows, it was just a matter of reconfiguring WDS, setting up the necessary structure and kickstart files for our automated Linux installations.  While I do not cover the initial WDS installation process, I will attempt to go over the steps performed after the basic WDS install (native or mixed).  <span id="more-29"></span></p>
<p>What you will need:</p>
<ul>
<li>Windows server running WDS (and working via DHCP).</li>
<li>A recent copy of <a href="http://www.kernel.org/pub/linux/utils/boot/syslinux/" target="_blank">SYSLINUX</a> (extracted to a folder somewhere on the WDS server).</li>
<li>An HTTP or anonymous FTP server to hold your installation media.</li>
</ul>
<p>Currently when I boot my computer with PXE enabled, I am prompted to hit F12 for network boot.  When I press F12, I am prompted by &#8220;Windows Boot Manager&#8221; to select my boot images that I setup in WDS.  Since I can&#8217;t install Linux images directly using the WDS interface, an alternative boot image is necessary.  That is where SYSLINUX/PXELINUX takes over.</p>
<p><strong>Pre-Setup</strong></p>
<ul>
<li>Create the necessary directory structure inside the WDS RemoteInstall directory (this was specified during the WDS installation).
<ul>
<li>Inside the x86 folder (<span style="text-decoration: underline;">RemoteInstall\Boot\x86\</span>), create the following folders (including pxelinux.cfg):
<ul>
<li>conf</li>
<li>img</li>
<li>knl</li>
<li>pxelinux.cfg</li>
</ul>
</li>
</ul>
</li>
</ul>
<p><strong>Preparing Installation Media</strong></p>
<ul>
<li>Setup an FTP server to hold your installation media (HTTP works also): Currently the average size of a Red Hat distribution is about 5GB, so make sure the server you select will have the necessary disk space. You will need separate installation media for both distribution specific 32bit and 64bit installs.  If you want Fedora 9, CentOS 5.2, and RHEL 5.2 images (both 32bit and 64bit), that will be about 30GB.  As long as you&#8217;re not archiving old distributions, this should not be an issue.
<ul>
<li>On my FTP server in the root/path, I created a directory for each of my installation media.  Also, creating a standard naming convention will help with editing the configuration files later and any case sensitivity issues.  Example: My directory names are DistroVersion_arc (Fedora9_32bit), as you will see later on.</li>
<li>Copy the entire installation dvd media to the corresponding directories you created (not the .iso, extract its entire contents).</li>
</ul>
</li>
<li>In the FTP root directory for the media you copied, create a kickstart file (ks.cfg).  (Example:  <a href="ftp://ftpserver.domain.com/fedora-9-32bit/ks.cfg">ftp://ftpserver.domain.com/Fedora9_32bit/ks.cfg</a>)  I have included example kickstart files at the bottom of this article.</li>
<li>Once you have copied the installation media for a distro to your FTP server, you need to copy 2 files from <span style="color: #ff0000;">that specific distro media</span> to your WDS server.
<ul>
<li>From the (installation media\images\pxeboot) directory, copy the following:
<ul>
<li>Copy vmlinuz to the following directory on the WDS server (<span style="text-decoration: underline;">RemoteInstall\Boot\x86\knl\</span>).  Rename the file to an identifying name such as vmlinuz-fedora9-32bit.</li>
<li>Copy initrd.img to the following directory on the WDS server (<span style="text-decoration: underline;">RemoteInstall\Boot\x86\img\</span>).  Rename the file to an identifying name such as initrd-fedora9-32bit.</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>When it comes time to configure your option menus, you will need to specify these files for each version/distro you plan on making available.</p>
<p><strong>Configuring WDS</strong></p>
<ul>
<li>From inside the downloaded SYSLINUX archive, copy the following files:
<ul>
<li><span style="text-decoration: underline;">pxelinux.0</span> from the (syslinux\core) directory to your (<span style="text-decoration: underline;">RemoteInstall\Boot\x86\</span>) directory on the WDS server.</li>
<li><span style="text-decoration: underline;">menu.c32</span> and <span style="text-decoration: underline;">vesamenu.c32</span> from the (syslinux\com32\menu) directory to your (<span style="text-decoration: underline;">RemoteInstall\Boot\x86\</span>) directory on the WDS server.</li>
</ul>
</li>
<li>Inside the (<span style="text-decoration: underline;">RemoteInstall\Boot\x86\</span>) directory, create copies of the following files, rename them accordingly (you can copy paste then rename):
<ul>
<li>Make a copy of pxeboot.n12, save it as pxeboot.0</li>
<li>Make a copy of abortpxe.com, save it as abortpxe.0</li>
</ul>
</li>
<li>Inside (<span style="text-decoration: underline;">RemoteInstall\Boot\x86\pxelinux.cfg\</span>), create a file called default.  This will be the initial menu you see during PXE boot, edit the file and give it the following contents:</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">       <span style="color: #666666; font-style: italic;"># File: wdspath\RemoteInstall\Boot\x86\pxelinux.cfg\default</span>
       <span style="color: #666666; font-style: italic;"># Default boot option to use</span>
       DEFAULT menu.c32
       TIMEOUT <span style="color: #000000;">50</span>
       <span style="color: #666666; font-style: italic;"># Prompt user for selection</span>
       PROMPT <span style="color: #000000;">0</span>
       <span style="color: #666666; font-style: italic;"># Menu Configuration</span>
       MENU WIDTH <span style="color: #000000;">80</span>
       MENU MARGIN <span style="color: #000000;">10</span>
       MENU PASSWORDMARGIN <span style="color: #000000;">3</span>
       MENU ROWS <span style="color: #000000;">12</span>
       MENU TABMSGROW <span style="color: #000000;">18</span>
       MENU CMDLINEROW <span style="color: #000000;">18</span>
       MENU ENDROW <span style="color: #000000;">24</span>
       MENU PASSWORDROW <span style="color: #000000;">11</span>
       MENU TIMEOUTROW <span style="color: #000000;">20</span>
       MENU TITLE Main Menu
&nbsp;
       <span style="color: #666666; font-style: italic;"># Menus</span>
       <span style="color: #666666; font-style: italic;"># Windows</span>
	LABEL Windows
	MENU LABEL Windows Installer
	KERNEL pxeboot.0
       <span style="color: #666666; font-style: italic;"># x86</span>
       LABEL x86
         MENU LABEL Linux 32bit Installs <span style="color: #7a0874; font-weight: bold;">&#40;</span>x86<span style="color: #7a0874; font-weight: bold;">&#41;</span>
         KERNEL menu.c32
         APPEND conf<span style="color: #000000; font-weight: bold;">/</span>x86.conf
       <span style="color: #666666; font-style: italic;"># x64</span>
       LABEL x64
         MENU LABEL Linux 64bit Installs <span style="color: #7a0874; font-weight: bold;">&#40;</span>x64<span style="color: #7a0874; font-weight: bold;">&#41;</span>
         KERNEL menu.c32
         APPEND conf<span style="color: #000000; font-weight: bold;">/</span>x64.conf
	<span style="color: #666666; font-style: italic;"># Windows</span>
	LABEL Exit
	MENU LABEL Exit
	KERNEL abortpxe.0</pre></div></div>

<ul>
<li>Now you need to create the sub-menu configuration files for your 32 and 64 bit installs that you specified in your default file (RemoteInstall\Boot\x86\conf\x86.conf and RemoteInstall\Boot\x86\conf\x64.conf respectively).  These files will list the available distros to install, and the path to your copied kernel\image files, including your kickstart file which contains the path for your FTP or HTTP installation media.  Each option needs to point to the specific kernel and image that was created from the installation media earlier.</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">       <span style="color: #666666; font-style: italic;"># File: wdspath\RemoteInstall\Boot\x86\conf\x86.conf</span>
       <span style="color: #666666; font-style: italic;"># Default boot option to use</span>
       DEFAULT menu.c32
       <span style="color: #666666; font-style: italic;"># Prompt user for selection</span>
       PROMPT <span style="color: #000000;">0</span>
       <span style="color: #666666; font-style: italic;"># Menu Configuration</span>
       MENU WIDTH <span style="color: #000000;">80</span>
       MENU MARGIN <span style="color: #000000;">10</span>
       MENU PASSWORDMARGIN <span style="color: #000000;">3</span>
       MENU ROWS <span style="color: #000000;">12</span>
       MENU TABMSGROW <span style="color: #000000;">18</span>
       MENU CMDLINEROW <span style="color: #000000;">18</span>
       MENU ENDROW <span style="color: #000000;">24</span>
       MENU PASSWORDROW <span style="color: #000000;">11</span>
       MENU TIMEOUTROW <span style="color: #000000;">20</span>
       MENU TITLE Linux32Bit <span style="color: #7a0874; font-weight: bold;">&#40;</span>x86<span style="color: #7a0874; font-weight: bold;">&#41;</span> OS Selection
       <span style="color: #666666; font-style: italic;"># Return to Main Menu</span>
       LABEL MainMenu
         MENU DEFAULT
         MENU LABEL ^Main Menu
         KERNEL menu.c32
       <span style="color: #666666; font-style: italic;">#</span>
       <span style="color: #666666; font-style: italic;"># Blank boots</span>
       <span style="color: #666666; font-style: italic;">#</span>
       LABEL Fedora <span style="color: #000000;">9</span> 32bit
         MENU LABEL Fedora <span style="color: #000000;">9</span> 32bit
         KERNEL knl<span style="color: #000000; font-weight: bold;">/</span>vmlinuz-fedora9-x86
         APPEND <span style="color: #007800;">initrd</span>=img<span style="color: #000000; font-weight: bold;">/</span>initrd-fedora9-x86.img <span style="color: #007800;">ks</span>=<span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>ftpserver.mydomain.com<span style="color: #000000; font-weight: bold;">/</span>Fedora9_32bit<span style="color: #000000; font-weight: bold;">/</span>ks.cfg</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">       <span style="color: #666666; font-style: italic;"># File: wdspath\RemoteInstall\Boot\x86\conf\x64.conf</span>
       <span style="color: #666666; font-style: italic;"># Default boot option to use</span>
       DEFAULT menu.c32
       <span style="color: #666666; font-style: italic;"># Prompt user for selection</span>
       PROMPT <span style="color: #000000;">0</span>
       <span style="color: #666666; font-style: italic;"># Menu Configuration</span>
       MENU WIDTH <span style="color: #000000;">80</span>
       MENU MARGIN <span style="color: #000000;">10</span>
       MENU PASSWORDMARGIN <span style="color: #000000;">3</span>
       MENU ROWS <span style="color: #000000;">12</span>
       MENU TABMSGROW <span style="color: #000000;">18</span>
       MENU CMDLINEROW <span style="color: #000000;">18</span>
       MENU ENDROW <span style="color: #000000;">24</span>
       MENU PASSWORDROW <span style="color: #000000;">11</span>
       MENU TIMEOUTROW <span style="color: #000000;">20</span>
       MENU TITLE 64Bit <span style="color: #7a0874; font-weight: bold;">&#40;</span>x64<span style="color: #7a0874; font-weight: bold;">&#41;</span> OS Choice
       <span style="color: #666666; font-style: italic;"># Return to Main Menu</span>
       LABEL MainMenu
         MENU DEFAULT
         MENU LABEL ^Main Menu
         KERNEL menu.c32
       <span style="color: #666666; font-style: italic;">#</span>
       <span style="color: #666666; font-style: italic;"># Blank boots</span>
       <span style="color: #666666; font-style: italic;">#</span>
       LABEL CentOS <span style="color: #000000;">5.2</span> 64bit
         MENU LABEL CentOS <span style="color: #000000;">5.2</span> 64bit
         KERNEL knl<span style="color: #000000; font-weight: bold;">/</span>vmlinuz-centos52-x64
         APPEND <span style="color: #007800;">initrd</span>=img<span style="color: #000000; font-weight: bold;">/</span>initrd-centos52-x64.img <span style="color: #007800;">ks</span>=<span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>ftpserver.mydomain.com<span style="color: #000000; font-weight: bold;">/</span>CentOS52_64bit<span style="color: #000000; font-weight: bold;">/</span>ks.cfg
       LABEL Fedora <span style="color: #000000;">9</span> 64bit
         MENU LABEL Fedora <span style="color: #000000;">9</span> 64bit
         KERNEL knl<span style="color: #000000; font-weight: bold;">/</span>vmlinuz-fedora9-x64
         APPEND <span style="color: #007800;">initrd</span>=img<span style="color: #000000; font-weight: bold;">/</span>initrd-fedora9-x64.img <span style="color: #007800;">ks</span>=<span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>ftpserver.mydomain.com<span style="color: #000000; font-weight: bold;">/</span>Fedora9_64bit<span style="color: #000000; font-weight: bold;">/</span>ks.cfg
       LABEL RHEL <span style="color: #000000;">5.2</span> 64bit
         MENU LABEL RHEL <span style="color: #000000;">5.2</span> 64bit
         KERNEL knl<span style="color: #000000; font-weight: bold;">/</span>vmlinuz-rhel52-x64
         APPEND <span style="color: #007800;">initrd</span>=img<span style="color: #000000; font-weight: bold;">/</span>initrd-rhel52-x64.img <span style="color: #007800;">ks</span>=<span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>ftpserver.mydomain.com<span style="color: #000000; font-weight: bold;">/</span>RHEL52_64bit<span style="color: #000000; font-weight: bold;">/</span>ks.cfg</pre></div></div>

<ul>
<li>Lastly, set WDS to use the pxelinux.0 boot image.  If you need to get to the normal WDS boot image, you can use the Windows Installer option created in your default menu.
<ul>
<li>Open Windows Deployment Services on your WDS server.  Right click your server -&gt; Properties.  Under the Boot tab, set the Default boot program for x86 architecture (Boot\x86\pxelinux.0), or browse to the pxelinux.0 file we created earlier.  You may leave the other architectures alone or change as you see fit.</li>
</ul>
</li>
</ul>
<p><a class="flickr-image" title="wds_properties" rel="flickr-mgr" href="http://www.flickr.com/photos/20873416@N08/2888619618/"><img class="flickr-medium" longdesc="http://farm3.static.flickr.com/2086/2888619618_315a352499_o.png" src="http://farm3.static.flickr.com/2086/2888619618_5404f127bc_t.jpg" alt="wds_properties" /></a></p>
<p>**For <strong>Windows 2008 R2</strong> installations you must set the bootimage via command-line as followed:</p>
<div>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">wdsutil <span style="color: #000000; font-weight: bold;">/</span>set-server <span style="color: #000000; font-weight: bold;">/</span>bootprogram:boot\x86\pxelinux.0 <span style="color: #000000; font-weight: bold;">/</span>Architecture:x86
wdsutil <span style="color: #000000; font-weight: bold;">/</span>set-server <span style="color: #000000; font-weight: bold;">/</span>bootprogram:boot\x86\pxelinux.0 <span style="color: #000000; font-weight: bold;">/</span>Architecture:x64
wdsutil <span style="color: #000000; font-weight: bold;">/</span>set-server <span style="color: #000000; font-weight: bold;">/</span>N12bootprogram:boot\x86\pxelinux.0 <span style="color: #000000; font-weight: bold;">/</span>Architecture:x86
wdsutil <span style="color: #000000; font-weight: bold;">/</span>set-server <span style="color: #000000; font-weight: bold;">/</span>N12bootprogram:boot\x86\pxelinux.0 <span style="color: #000000; font-weight: bold;">/</span>Architecture:x64</pre></div></div>

</div>
<p><strong>Finished Result</strong></p>
<p><a href="http://www.ohjeah.net/wp-content/uploads/2008/10/linux_pxe.swf" rel="shadowbox[post-29];width=640;height=385;"></a><a href="http://www.ohjeah.net/2008/09/24/pxe-and-kickstart-automated-installations-for-linux-via-wds/"><p><em>Click here to view the embedded video.</em></p></a></p>
<p><strong>Example Kickstart File</strong></p>
<p>Here is an example kickstart file for Fedora 9.  For each new distro I normally perform a cd install with my desired options, then use the resulting /root/anaconda-cfg.ks for assistance.  Note that the kickstart file specifies the FTP path of your installation media that you created in the beginning of this article.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#Version=F9</span>
<span style="color: #666666; font-style: italic;">#32bit</span>
<span style="color: #c20cb9; font-weight: bold;">install</span>
text
url <span style="color: #660033;">--url</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>ftpserver.mydomain.com<span style="color: #000000; font-weight: bold;">/</span>Fedora9_32bit
lang en_US.UTF-<span style="color: #000000;">8</span>
keyboard us
network <span style="color: #660033;">--device</span> eth0 <span style="color: #660033;">--bootproto</span> dhcp
rootpw <span style="color: #660033;">--iscrypted</span> $<span style="color: #000000;">1</span><span style="color: #007800;">$X</span>.qPQYdk<span style="color: #007800;">$L</span>.YRbuORBd30
firewall <span style="color: #660033;">--disabled</span>
authconfig <span style="color: #660033;">--enableshadow</span> <span style="color: #660033;">--enablemd5</span> <span style="color: #660033;">--passalgo</span>=sha512
selinux <span style="color: #660033;">--disabled</span>
timezone America<span style="color: #000000; font-weight: bold;">/</span>Chicago
bootloader <span style="color: #660033;">--location</span>=mbr <span style="color: #660033;">--driveorder</span>=sda <span style="color: #660033;">--append</span>=<span style="color: #ff0000;">&quot;rhgb quiet&quot;</span>
clearpart <span style="color: #660033;">--all</span> <span style="color: #660033;">--drives</span>=sda
part <span style="color: #000000; font-weight: bold;">/</span>boot <span style="color: #660033;">--fstype</span> ext3 <span style="color: #660033;">--size</span>=<span style="color: #000000;">1000</span>
part swap <span style="color: #660033;">--size</span>=<span style="color: #000000;">2048</span>
part <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">--fstype</span> ext3 <span style="color: #660033;">--size</span>=<span style="color: #000000;">1</span> <span style="color: #660033;">--grow</span>
<span style="color: #000000; font-weight: bold;">%</span>packages
<span style="color: #000000; font-weight: bold;">@</span>editors
<span style="color: #000000; font-weight: bold;">@</span>development-tools
<span style="color: #000000; font-weight: bold;">@</span>text-internet
<span style="color: #000000; font-weight: bold;">@</span>core
<span style="color: #000000; font-weight: bold;">@</span>base
<span style="color: #000000; font-weight: bold;">@</span>hardware-support
<span style="color: #000000; font-weight: bold;">@</span>admin-tools
grub
openldap
openldap-devel
openldap-client
net-snmp<span style="color: #000000; font-weight: bold;">*</span>
ntp</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.ohjeah.net/2008/09/24/pxe-and-kickstart-automated-installations-for-linux-via-wds/feed/</wfw:commentRss>
		<slash:comments>47</slash:comments>
		</item>
		<item>
		<title>Linux SSH + PAM + LDAP + 2003 R2 AD Deployment</title>
		<link>http://www.ohjeah.net/2008/09/23/linux-ssh-pam-ldap-2003-r2-ad-deployment/</link>
		<comments>http://www.ohjeah.net/2008/09/23/linux-ssh-pam-ldap-2003-r2-ad-deployment/#comments</comments>
		<pubDate>Tue, 23 Sep 2008 14:47:47 +0000</pubDate>
		<dc:creator>jro</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[AD]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[pam]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://nativemo.de/?p=33</guid>
		<description><![CDATA[Often I find my self working in a department where the skill sets of individuals varies significantly, and my current position is no different.  While there is nothing wrong with this, there have been several occasions (like being on vacation), where help desk personnel or other less savvy users are called upon to perform basic [...]]]></description>
			<content:encoded><![CDATA[<p>Often I find my self working in a department where the skill sets of individuals varies significantly, and my current position is no different.  While there is nothing wrong with this, there have been several occasions (like being on vacation), where help desk personnel or other less savvy users are called upon to perform basic functions .  <span id="more-23"></span>When you start dealing with a group of servers, it can be troublesome to maintain a local user base without some form of directory authentication.  Since most corporate offices still revolve around Windows at the desktop, Active directory becomes a very logical option.</p>
<p>This will basically document the steps I performed in setting up our Linux machines (Fedora 9, RHEL 5, CentOS 5) to authenticate against our Active Directory domain for SSH, while restricting access to a specific security group so that we can give only specific users access as needed.  While I have only used this with Red Hat distros, it may be helpful to others.</p>
<p><strong>Phase 1:</strong> Preparing Active Directory</p>
<p>While <a href="http://technet.microsoft.com/en-us/interopmigration/bb380242.aspx" target="_blank">Windows Services for UNIX</a> is still available, Microsoft was nice enough to include a similar feature with Windows 2003 R2 out of the box.  In add/remove Windows components under Active Directory Services, you will find <span style="text-decoration: underline;">Identity Management for UNIX</span>.  This will install the necessary LDAP attributes we need for getting this all to work, and will give you a new tab &#8220;UNIX Attributes&#8221; for your users.</p>
<p><strong>Phase 2:</strong> Preparing Groups</p>
<p>Now create your first security group, note that it is beneficial not to include special characters or spaces in your group name.  Once your group has been created edit the UNIX Attributes under properties and set it to the default created NIS Domain, you may leave the Group ID or change as needed.</p>
<p><strong>Phase 3:</strong> Preparing Users</p>
<p>Once your security group has been setup (I named mine LinuxUsers), you can setup add your users.  Under user properties, you will see a tab &#8220;UNIX Attributes&#8221; that contain our specific LDAP attributes.  Even though we won&#8217;t be using NIS, you have to set the NIS Domain to have access to other options.  As for the rest of the attributes, I personally prefer to use bash (/bin/bash) and ensure that home directories are all lower case.</p>
<p><strong>Phase 4: </strong>Configuring Linux</p>
<p>The hardest part of this setup was getting the correct DN where needed.  Due to our number of organizational units, I ended up using <a href="http://www.jxplorer.org/">jxplore</a> a few times which made finding a specific DN much easier.</p>
<p>Packages: openldap, openldap-devel, pam, pam_krb5, ntp</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># yum install openldap, openldap-devel, pam, pam_krb5, ntp</span></pre></div></div>

<p>In order to log in, you must make sure your time is synchronized with your domain controller.  Since we use an external ntp server on our domain controller, we are going to sync with the same server before continuing.  An optional step would be to setup a cron job to synchronize the date and time consistently.  Also note that nptd must be stopped before updating, so in case you had it installed prior make sure the service is stopped.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># /etc/rc.d/init.d/ntpd stop</span>
<span style="color: #666666; font-style: italic;"># ntpdate -u pool.ntp.org</span>
<span style="color: #666666; font-style: italic;"># /etc/rc.d/init.d/ntpd start</span></pre></div></div>

<p>Now there are several configuration files we must update, I will list the file paths I used and examples, though it may be different.  In these examples, MYDOMAIN.COM is our active directory domain, and pdc.mydomain.com is our domain controller.</p>
<p><span style="color: #3366ff;">/etc/krb.conf</span></p>
<p>(Example)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">MYDOMAIN.COM
MYDOMAIN.COM pdc.mydomain.com</pre></div></div>

<p><span style="color: #3366ff;">/etc/krb5.conf</span></p>
<p>(Example)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>logging<span style="color: #7a0874; font-weight: bold;">&#93;</span>
 default = FILE:<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>krb5libs.log
 kdc = FILE:<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>krb5kdc.log
 admin_server = FILE:<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>kadmind.log
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>libdefaults<span style="color: #7a0874; font-weight: bold;">&#93;</span>
 default_realm = MYDOMAIN.COM
 dns_lookup_realm = <span style="color: #c20cb9; font-weight: bold;">true</span>
 dns_lookup_kdc = <span style="color: #c20cb9; font-weight: bold;">true</span>
 ticket_lifetime = 24h
 forwardable = <span style="color: #c20cb9; font-weight: bold;">yes</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>realms<span style="color: #7a0874; font-weight: bold;">&#93;</span>
 MYDOMAIN.COM = <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  kdc = pdc.mydomain.com
  kdc = bdc.mydomain.com
 <span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>domain_realm<span style="color: #7a0874; font-weight: bold;">&#93;</span>
 .MYDOMAIN.COM = MYDOMAIN.COM
 MYDOMIN.COM = MYDOMAIN.COM
&nbsp;
 mydomain.com = MYDOMAIN.COM
 .mydomain.com = MYDOMAIN.COM
<span style="color: #7a0874; font-weight: bold;">&#91;</span>appdefaults<span style="color: #7a0874; font-weight: bold;">&#93;</span>
 pam = <span style="color: #7a0874; font-weight: bold;">&#123;</span>
   debug = <span style="color: #c20cb9; font-weight: bold;">false</span>
   ticket_lifetime = <span style="color: #000000;">36000</span>
   renew_lifetime = <span style="color: #000000;">36000</span>
   forwardable = <span style="color: #c20cb9; font-weight: bold;">true</span>
   krb4_convert = <span style="color: #c20cb9; font-weight: bold;">false</span>
 <span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p><span style="color: #3366ff;">/etc/ldap.conf </span>(<span style="color: #ff0000;">NOTE: You must create a normal user for your Linux servers to bind to AD with, also you will need to change these DNs specific to your setup.</span>)</p>
<p>(Example)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Must be RESOLVABLE</span>
host pdc.mydomain.com bdc.mydomain.com
&nbsp;
<span style="color: #666666; font-style: italic;"># The distinguished name of the search base.</span>
base <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">dc</span></span>=mydomain,<span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">dc</span></span>=com
&nbsp;
<span style="color: #666666; font-style: italic;"># Bind user you created in AD</span>
<span style="color: #666666; font-style: italic;"># The credentials to bind with.</span>
binddn <span style="color: #007800;">CN</span>=ldapuser,<span style="color: #007800;">OU</span>=Users,<span style="color: #007800;">DC</span>=mydomain,<span style="color: #007800;">DC</span>=com
bindpw Password123
&nbsp;
<span style="color: #666666; font-style: italic;"># The search scope.</span>
scope sub
&nbsp;
<span style="color: #666666; font-style: italic;"># Search timelimit</span>
timelimit <span style="color: #000000;">30</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Bind/connect timelimit</span>
bind_timelimit <span style="color: #000000;">30</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Idle timelimit; client will close connections</span>
<span style="color: #666666; font-style: italic;"># (nss_ldap only) if the server has not been contacted</span>
<span style="color: #666666; font-style: italic;"># for the number of seconds specified below.</span>
idle_timelimit <span style="color: #000000;">3600</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Group to enforce membership of</span>
<span style="color: #666666; font-style: italic;"># The group you setup in AD that contains your linux users</span>
pam_groupdn <span style="color: #007800;">CN</span>=LinuxUsers,<span style="color: #007800;">OU</span>=Groups,<span style="color: #007800;">DC</span>=mydomain,<span style="color: #007800;">DC</span>=com
&nbsp;
<span style="color: #666666; font-style: italic;"># Group member attribute</span>
pam_member_attribute member
&nbsp;
<span style="color: #666666; font-style: italic;"># Update Active Directory password, by</span>
<span style="color: #666666; font-style: italic;"># creating Unicode password and updating</span>
<span style="color: #666666; font-style: italic;"># unicodePwd attribute.</span>
pam_password ad
&nbsp;
nss_base_passwd    <span style="color: #007800;">ou</span>=Users,<span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">dc</span></span>=mydomain,<span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">dc</span></span>=com?sub
nss_base_shadow    <span style="color: #007800;">ou</span>=Users,<span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">dc</span></span>=mydomain,<span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">dc</span></span>=com?sub
nss_base_group     <span style="color: #007800;">ou</span>=Users,<span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">dc</span></span>=mydomain,<span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">dc</span></span>=com?sub
&nbsp;
<span style="color: #666666; font-style: italic;"># Just assume that there are no supplemental groups for these named users</span>
nss_initgroups_ignoreusers root,ldap,named,avahi,haldaemon,dbus,radvd,tomcat,radiusd,news,mailman
&nbsp;
<span style="color: #666666; font-style: italic;"># RFC 2307 (AD) mappings</span>
nss_map_objectclass posixAccount user
nss_map_objectclass shadowAccount user
nss_map_attribute uid sAMAccountName
nss_map_attribute homeDirectory unixHomeDirectory
nss_map_attribute shadowLastChange pwdLastSet
nss_map_objectclass posixGroup group
nss_map_attribute uniqueMember member
pam_login_attribute sAMAccountName
pam_filter <span style="color: #007800;">objectclass</span>=User
pam_password ad
&nbsp;
<span style="color: #666666; font-style: italic;"># Disable SASL security layers. This is needed for AD.</span>
sasl_secprops <span style="color: #007800;">maxssf</span>=<span style="color: #000000;">0</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Override the default Kerberos ticket cache location.</span>
krb5_ccname FILE:<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>.ldapcache
ssl no</pre></div></div>

<p><span style="color: #3366ff;">/etc/nsswitch.conf</span></p>
<p>Append ldap to the end of the following lines:</p>
<ul>
<li>passwd:</li>
<li>shadow:</li>
<li>group:</li>
<li>netgroup:</li>
</ul>
<p>(Example)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">passwd</span>:     files ldap
shadow:     files ldap
group:      files ldap
hosts:      files dns
bootparams: nisplus <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">NOTFOUND</span>=<span style="color: #7a0874; font-weight: bold;">return</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> files
ethers:     files
netmasks:   files
networks:   files
protocols:  files
rpc:        files
services:   files
netgroup:   files ldap
publickey:  nisplus
automount:  files ldap
aliases:    files nisplus</pre></div></div>

<p><span style="color: #3366ff;">/etc/pam.d/sshd<span style="color: #000000;"> &#8211; Add the following ldap and krb5 pam modules, also create users home directory if it does not exist.</span></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">auth        sufficient    pam_krb5.so use_first_pass
auth        sufficient    pam_ldap.so use_first_pass
&nbsp;
account     <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">default</span>=bad <span style="color: #007800;">success</span>=ok <span style="color: #007800;">user_unknown</span>=ignore<span style="color: #7a0874; font-weight: bold;">&#93;</span> pam_ldap.so
account     <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">default</span>=bad <span style="color: #007800;">success</span>=ok <span style="color: #007800;">user_unknown</span>=ignore<span style="color: #7a0874; font-weight: bold;">&#93;</span> pam_krb5.so
&nbsp;
password    sufficient    pam_krb5.so use_authtok
password    sufficient    pam_ldap.so use_authtok
&nbsp;
session     optional      pam_krb5.so
session     optional      pam_ldap.so
&nbsp;
session     required      pam_mkhomedir.so <span style="color: #007800;"><span style="color: #7a0874; font-weight: bold;">umask</span></span>=0022 <span style="color: #007800;">skel</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>skel silent</pre></div></div>

<p>(Example)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#%PAM-1.0</span>
auth        sufficient    pam_krb5.so use_first_pass
auth        sufficient    pam_ldap.so use_first_pass
auth       include      system-auth
&nbsp;
account     <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">default</span>=bad <span style="color: #007800;">success</span>=ok <span style="color: #007800;">user_unknown</span>=ignore<span style="color: #7a0874; font-weight: bold;">&#93;</span> pam_ldap.so
account     <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">default</span>=bad <span style="color: #007800;">success</span>=ok <span style="color: #007800;">user_unknown</span>=ignore<span style="color: #7a0874; font-weight: bold;">&#93;</span> pam_krb5.so
account    required     pam_nologin.so
account    include      system-auth
&nbsp;
password    sufficient    pam_krb5.so use_authtok
password    sufficient    pam_ldap.so use_authtok
password   include      system-auth
&nbsp;
session     optional      pam_krb5.so
session     optional      pam_ldap.so
session    optional     pam_keyinit.so force revoke
session    include      system-auth
session    required     pam_loginuid.so
session     required      pam_mkhomedir.so <span style="color: #007800;"><span style="color: #7a0874; font-weight: bold;">umask</span></span>=0022 <span style="color: #007800;">skel</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>skel silent</pre></div></div>

<p>Verify ldap authentication is working by logging in under a domain account with the correct permissions. You can watch the security log for information on failures.</p>
<p><strong>Phase 5:</strong> Giving SUDO permissions (Optional)</p>
<p>Add the group to your sudoers file using %groupname.</p>
<p>(Example)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Give our Windows Group linuxusers (system admins), ALL commands.</span>
<span style="color: #000000; font-weight: bold;">%</span>linuxusers     <span style="color: #007800;">ALL</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span>ALL<span style="color: #7a0874; font-weight: bold;">&#41;</span>       ALL</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.ohjeah.net/2008/09/23/linux-ssh-pam-ldap-2003-r2-ad-deployment/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

