<?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>Surgical Diversions &#187; osx-server</title>
	<atom:link href="http://thefragens.com/blog/tag/osx-server/feed/" rel="self" type="application/rss+xml" />
	<link>http://thefragens.com/blog</link>
	<description>My time out of the operating room.</description>
	<lastBuildDate>Wed, 21 Dec 2011 17:05:11 +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>chroot&#8217;d SFTP on Mac OS X server</title>
		<link>http://thefragens.com/blog/2011/12/chrootd-sftp-on-mac-os-x-server/</link>
		<comments>http://thefragens.com/blog/2011/12/chrootd-sftp-on-mac-os-x-server/#comments</comments>
		<pubDate>Fri, 16 Dec 2011 00:27:25 +0000</pubDate>
		<dc:creator>Andy Fragen</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[osx-server]]></category>

		<guid isPermaLink="false">http://thefragens.com/blog/?p=914</guid>
		<description><![CDATA[So here you are finding that you need to grant someone else SFTP access to your server. There are lots of reasons to do this, in my case it&#8217;s because I needed to grant access to someone&#8217;s web designer. We &#8230; <a href="http://thefragens.com/blog/2011/12/chrootd-sftp-on-mac-os-x-server/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://thefragens.com/blog/2010/05/server-side-email-filtering-with-sieve/' rel='bookmark' title='Server-Side Email Filtering with Sieve'>Server-Side Email Filtering with Sieve</a> <small>Another post for the peripheral brain. When I first set...</small></li>
<li><a href='http://thefragens.com/blog/2010/06/wordpress-automatic-updates/' rel='bookmark' title='WordPress Automatic Updates'>WordPress Automatic Updates</a> <small>I think I finally have the automatic updates feature of...</small></li>
<li><a href='http://thefragens.com/blog/2010/08/dovecot-permissions/' rel='bookmark' title='Dovecot Permissions'>Dovecot Permissions</a> <small>Well, I finally bit the bullet and installed OS X...</small></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>So here you are finding that you need to grant someone else SFTP access to your server. There are lots of reasons to do this, in my case it&#8217;s because I needed to grant access to someone&#8217;s web designer. We initially worked it out by him emailing me files and me SFTP&#8217;ing them up to the server in the correct location. Now he needs direct access to fix some things and I want to give him only what he needs without compromising security. Enter the chroot jail. After lots of googling and some encouragement from the Mac OS X Server email list, I&#8217;ve got it working. Here&#8217;s how it works.</p>

<p>First, you should create the new user in Workgroup Admin and either assign them access privileges for SSH via Server Admin or assign them to a group that has SSH access privileges. Further discussion is below.</p>

<p>From the Terminal, start off right.</p>

<pre><code>sudo cp /etc/sshd_config /etc/sshd_config.bkup

sudo chown root /
sudo chmod 755 /
sudo mkdir -p /chroot/user/scratchpad
sudo chown -R root /chroot
sudo chown user /chroot/user/scratchpad
sudo chmod -R 755 /chroot
</code></pre>

<p>Every additional new user added will then be something along the lines of the following.</p>

<pre><code>sudo mkdir -p /chroot/user2/scratchpad
sudo chown root /chroot/user2
sudo chown user2 /chroot/user2/scratchpad
sudo chmod -R 755 /chroot/user2
</code></pre>

<p>Every folder it the path to the chroot jail must be owned by <code>root</code>. I don&#8217;t think it matters what group the folder is in. What I did above was to </p>

<ol>
<li>backup <code>/etc/sshd_config</code></li>
<li>change ownership of the root directory to <code>root</code></li>
<li>change permissions of the root directory to 755</li>
<li>create a chroot folder</li>
<li>create a user folder inside the chroot folder</li>
<li>create a folder inside the user folder that user can modify</li>
<li>set ownership and permissions</li>
</ol>

<p>Now to edit <code>/etc/sshd_config</code> to the following.</p>

<pre><code>#Subsystem  sftp    /usr/libexec/sftp-server
Subsystem   sftp    internal-sftp

Match User user
    X11Forwarding no
    AllowTcpForwarding no
    ForceCommand internal-sftp
    ChrootDirectory /chroot/user
</code></pre>

<p>This creates a chroot jail that when the user logs in will drop them into the folder <code>/chroot/user</code>, in that folder is a folder they can add things to <code>/chroot/user/scratchpad</code>.</p>

<p>If you want to create a Group in Workgroup Admin for &#8216;Chroot Users&#8217; then add the new users that you created in Workgroup Admin to the Group you won&#8217;t have to keep editing the <code>/etc/sshd_config</code> file. Instead of the above, add the following. Make sure you add the &#8216;Chroot Users&#8217; group to the SSH access ACL in Server Admin.</p>

<pre><code>Match Group chrootusers
    X11Forwarding no
    AllowTcpForwarding no
    ForceCommand internal-sftp
    ChrootDirectory /chroot/%u
</code></pre>

<p>To test whether the above is working, issue the following from the terminal.</p>

<pre><code>$ sftp user@domain.com
Password:
sftp&gt;
</code></pre>

<p>Getting in is one thing. Now you have to mount the folder you want to use. Unfortunately you can&#8217;t use a symlink inside of a chroot jail. This is where <a href="http://www.macports.org">MacPorts</a> is your best friend. I don&#8217;t know why I&#8217;ve never seen fit to install this before. After installation just issue the following commands.</p>

<pre><code>sudo port install fuse4x
sudo port install fuse4x bindfs
</code></pre>

<p>You might have to restart. Now with an empty folder created in <code>/chroot/user</code> you can <code>mount --bind</code> to a folder outside of the chroot jail. For example</p>

<pre><code>sudo /opt/local/bin/bindfs -u user /Library/WebServer/Documents/mysite/yourfolder /chroot/user/scratchpad
</code></pre>

<p>So far this seems to work here.</p>
<p>Related posts:<ol>
<li><a href='http://thefragens.com/blog/2010/05/server-side-email-filtering-with-sieve/' rel='bookmark' title='Server-Side Email Filtering with Sieve'>Server-Side Email Filtering with Sieve</a> <small>Another post for the peripheral brain. When I first set...</small></li>
<li><a href='http://thefragens.com/blog/2010/06/wordpress-automatic-updates/' rel='bookmark' title='WordPress Automatic Updates'>WordPress Automatic Updates</a> <small>I think I finally have the automatic updates feature of...</small></li>
<li><a href='http://thefragens.com/blog/2010/08/dovecot-permissions/' rel='bookmark' title='Dovecot Permissions'>Dovecot Permissions</a> <small>Well, I finally bit the bullet and installed OS X...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://thefragens.com/blog/2011/12/chrootd-sftp-on-mac-os-x-server/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Squirrelmail Plugins</title>
		<link>http://thefragens.com/blog/2011/03/squirrelmail-plugins/</link>
		<comments>http://thefragens.com/blog/2011/03/squirrelmail-plugins/#comments</comments>
		<pubDate>Thu, 17 Mar 2011 22:59:09 +0000</pubDate>
		<dc:creator>Andy Fragen</dc:creator>
				<category><![CDATA[osx-server]]></category>
		<category><![CDATA[squirrelmail]]></category>

		<guid isPermaLink="false">http://thefragens.com/blog/?p=852</guid>
		<description><![CDATA[Just an FYI post. I save all my added Squirrelmail plugins in /Users/Shared/squirrelmail_plugins/. Consequently if I need to reinstall any or all of them all I have to do is issue the following&#8230; sudo cp -R /Users/Shared/squirrelmail_plugins/PLUGIN_FOLDER \ /usr/share/squirrelmail/plugins sudo &#8230; <a href="http://thefragens.com/blog/2011/03/squirrelmail-plugins/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://thefragens.com/blog/2010/05/server-side-email-filtering-with-sieve/' rel='bookmark' title='Server-Side Email Filtering with Sieve'>Server-Side Email Filtering with Sieve</a> <small>Another post for the peripheral brain. When I first set...</small></li>
<li><a href='http://thefragens.com/blog/2008/03/webmail-authentication/' rel='bookmark' title='Webmail Authentication'>Webmail Authentication</a> <small>OK, my problem with my webmail and my Thunderbird user...</small></li>
<li><a href='http://thefragens.com/blog/2010/05/false-positive/' rel='bookmark' title='False Positive'>False Positive</a> <small>Just a personal reminder to keep in the memory bank....</small></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Just an FYI post.</p>

<p>I save all my added <a href="http://squirrelmail.org/index.php">Squirrelmail</a> plugins in <code>/Users/Shared/squirrelmail_plugins/</code>. Consequently if I need to reinstall any or all of them all I have to do is issue the following&#8230;</p>

<pre><code>sudo cp -R /Users/Shared/squirrelmail_plugins/PLUGIN_FOLDER \
  /usr/share/squirrelmail/plugins
sudo /usr/share/squirrelmail/config/conf.pl
</code></pre>

<p>Activate the plugins, save, quit and you&#8217;re good to go.</p>
<p>Related posts:<ol>
<li><a href='http://thefragens.com/blog/2010/05/server-side-email-filtering-with-sieve/' rel='bookmark' title='Server-Side Email Filtering with Sieve'>Server-Side Email Filtering with Sieve</a> <small>Another post for the peripheral brain. When I first set...</small></li>
<li><a href='http://thefragens.com/blog/2008/03/webmail-authentication/' rel='bookmark' title='Webmail Authentication'>Webmail Authentication</a> <small>OK, my problem with my webmail and my Thunderbird user...</small></li>
<li><a href='http://thefragens.com/blog/2010/05/false-positive/' rel='bookmark' title='False Positive'>False Positive</a> <small>Just a personal reminder to keep in the memory bank....</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://thefragens.com/blog/2011/03/squirrelmail-plugins/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Setting up WebDAV Share in Mac OS X Server</title>
		<link>http://thefragens.com/blog/2011/03/setting-up-webdav-share-in-mac-os-x-server/</link>
		<comments>http://thefragens.com/blog/2011/03/setting-up-webdav-share-in-mac-os-x-server/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 01:33:39 +0000</pubDate>
		<dc:creator>Andy Fragen</dc:creator>
				<category><![CDATA[osx-server]]></category>

		<guid isPermaLink="false">http://thefragens.com/blog/?p=843</guid>
		<description><![CDATA[As I attempt to transition from a laptop to an iPad, with no specific reason other than the iPad is sooooo kewl; I need to create my own online storage. Yes I have a Dropbox account, but I don&#8217;t control &#8230; <a href="http://thefragens.com/blog/2011/03/setting-up-webdav-share-in-mac-os-x-server/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://thefragens.com/blog/2010/08/setting-up-snow-leopard-ical-server/' rel='bookmark' title='Setting up Snow Leopard iCal Server'>Setting up Snow Leopard iCal Server</a> <small>After scouring through the official documentation, and finding that lacking,...</small></li>
<li><a href='http://thefragens.com/blog/2011/12/chrootd-sftp-on-mac-os-x-server/' rel='bookmark' title='chroot&#8217;d SFTP on Mac OS X server'>chroot&#8217;d SFTP on Mac OS X server</a> <small>So here you are finding that you need to grant...</small></li>
<li><a href='http://thefragens.com/blog/2010/11/fail2ban-and-os-x-server-part-deux/' rel='bookmark' title='Fail2ban and OS X Server, part deux'>Fail2ban and OS X Server, part deux</a> <small>As some of you might know I run my own...</small></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>As I attempt to transition from a laptop to an iPad, with no specific reason other than the iPad is sooooo kewl; I need to create my own online storage. Yes I have a <a href="http://www.dropbox.com">Dropbox</a> account, but I don&#8217;t control Dropbox.</p>

<p>Here&#8217;s what I did, YMMV.</p>

<ol>
<li>From Server Admin, make new Web > Realm and set appropriate ACLs.</li>
<li>Create a folder in location/volume where data for Share is physically located.</li>
<li>Change permissions of folder to <code>_www:admin</code> (that&#8217;s what works for me)</li>
<li>Create a symlink to the share folder in the folder where your web server looks to for the domain&#8217;s data.</li>
</ol>

<p>I know there probably a bit of information missing and if I showed images of the actual steps it might make things a bit clearer but I&#8217;m a little paranoid about my server and I don&#8217;t want to risk opening it up to further attack.</p>

<p>All this needs to be done before OS X will allow a <code>"Connect to Server..."</code> and mount your WebDAV share.</p>
<p>Related posts:<ol>
<li><a href='http://thefragens.com/blog/2010/08/setting-up-snow-leopard-ical-server/' rel='bookmark' title='Setting up Snow Leopard iCal Server'>Setting up Snow Leopard iCal Server</a> <small>After scouring through the official documentation, and finding that lacking,...</small></li>
<li><a href='http://thefragens.com/blog/2011/12/chrootd-sftp-on-mac-os-x-server/' rel='bookmark' title='chroot&#8217;d SFTP on Mac OS X server'>chroot&#8217;d SFTP on Mac OS X server</a> <small>So here you are finding that you need to grant...</small></li>
<li><a href='http://thefragens.com/blog/2010/11/fail2ban-and-os-x-server-part-deux/' rel='bookmark' title='Fail2ban and OS X Server, part deux'>Fail2ban and OS X Server, part deux</a> <small>As some of you might know I run my own...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://thefragens.com/blog/2011/03/setting-up-webdav-share-in-mac-os-x-server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Updating DNS settings</title>
		<link>http://thefragens.com/blog/2011/02/updating-dns-settings/</link>
		<comments>http://thefragens.com/blog/2011/02/updating-dns-settings/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 22:05:04 +0000</pubDate>
		<dc:creator>Andy Fragen</dc:creator>
				<category><![CDATA[osx-server]]></category>
		<category><![CDATA[dns]]></category>

		<guid isPermaLink="false">http://thefragens.com/blog/?p=810</guid>
		<description><![CDATA[Just to document. I&#8217;ve updated the settings in /etc/named/named.ca by using the following command and then restarting DNS. sudo curl ftp://ftp.internic.net/domain/named.root -o /var/named/named.ca Not sure how often this should be done. I also added the following to /etc/named.conf to reduced &#8230; <a href="http://thefragens.com/blog/2011/02/updating-dns-settings/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://thefragens.com/blog/2009/03/amavisd-settings/' rel='bookmark' title='Amavisd settings'>Amavisd settings</a> <small>I run my own mail server on OS X Server....</small></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Just to document. I&#8217;ve updated the settings in <code>/etc/named/named.ca</code> by using the following command and then restarting DNS.</p>

<blockquote>
  <p><code>sudo curl ftp://ftp.internic.net/domain/named.root -o /var/named/named.ca</code></p>
</blockquote>

<p>Not sure how often this should be done.</p>

<p>I also added the following to <code>/etc/named.conf</code> to reduced the error logging. I got that <a href="http://groups.google.com/group/comp.protocols.dns.bind/browse_thread/thread/cfa8c63ec6bd08d6">tidbit from google groups</a></p>

<blockquote>
  <p>logging {<br />
    <code>category lame-servers { null; };</code><br />
    <code>category edns-disabled { null; };</code><br />
  };  </p>
</blockquote>
<p>Related posts:<ol>
<li><a href='http://thefragens.com/blog/2009/03/amavisd-settings/' rel='bookmark' title='Amavisd settings'>Amavisd settings</a> <small>I run my own mail server on OS X Server....</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://thefragens.com/blog/2011/02/updating-dns-settings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fail2ban Problems and Solutions</title>
		<link>http://thefragens.com/blog/2010/12/fail2ban-problems-and-solutions/</link>
		<comments>http://thefragens.com/blog/2010/12/fail2ban-problems-and-solutions/#comments</comments>
		<pubDate>Wed, 01 Dec 2010 21:13:34 +0000</pubDate>
		<dc:creator>Andy Fragen</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[osx-server]]></category>
		<category><![CDATA[fail2ban]]></category>

		<guid isPermaLink="false">http://thefragens.com/blog/?p=815</guid>
		<description><![CDATA[If you use Fail2ban then you are probably aware of the fact that you must add a rule number to the ipfw deny rule for actionban in ipfw.conf. If you don&#8217;t add a rule number then there is no way &#8230; <a href="http://thefragens.com/blog/2010/12/fail2ban-problems-and-solutions/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://thefragens.com/blog/2009/09/fail2ban-on-leopard-server/' rel='bookmark' title='Fail2ban on Leopard Server'>Fail2ban on Leopard Server</a> <small>So here I am running my own server &#8212; for...</small></li>
<li><a href='http://thefragens.com/blog/2010/11/checking-fail2ban-regex/' rel='bookmark' title='Checking Fail2ban regex'>Checking Fail2ban regex</a> <small>I&#8217;ve just stumbled across a great command in Fail2ban to...</small></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>If you use <a href="http://www.fail2ban.org/wiki/index.php/Main_Page">Fail2ban</a> then you are probably aware of the fact that you must add a rule number to the ipfw deny rule for <code>actionban</code> in <code>ipfw.conf</code>. If you don&#8217;t add a rule number then there is no way for fail2ban to delete the rule after it expires. The problem lies in that you can easily set a different rule number for each filter but if the filter adds many rules within it&#8217;s ban time then when that first <code>actionunban</code> gets triggered all rules with the same number are removed, even if there full ban time has not transpired.</p>

<p>I was looking for an elegant solution to this and finally figured out how to do it myself. What I&#8217;ve done is in the <code>ipfw.conf</code> file I&#8217;ve added a variable that will create a random number between 10000 and 12000 to use as the rule number.</p>

<p>The code is pretty simple.</p>

<blockquote>
  <p><code>echo $((RANDOM%2000+10000))</code></p>
</blockquote>

<p>There needs to be an extra <code>%</code> in there for it to work. I think it has something to do with python. So far it seems to be working pretty good here. While it is possible that I could get a duplicate rule number, it&#8217;s unlikely.</p>

<p>I&#8217;ve modified my installation of Fail2ban significantly; but only by adding filters, jails, etc. <a href="http://thefragens.com/pub/install_fail2ban_mods.tar.gz">Here&#8217;s a bundled version of all of my modifications.</a> <a href="http://thefragens.com/blog/2010/11/fail2ban-and-os-x-server-part-deux/">Here are instructions for using my modifications.</a> So far everything seems to be working great. I&#8217;ve had to add a few items to <code>ignoreregex</code> so I don&#8217;t ban people using their iPhones on 3G or at home from certain dynamic IP cable providers.</p>

<p>What I&#8217;ve done is a <code>host</code> lookup on the IP that&#8217;s banned and if I find it&#8217;s a local ISP, like Verizon or Time Warner Cable, I add part of their host lookup to the <code>ignoreregex</code> list. So far it seems to be doing the trick.</p>
<p>Related posts:<ol>
<li><a href='http://thefragens.com/blog/2009/09/fail2ban-on-leopard-server/' rel='bookmark' title='Fail2ban on Leopard Server'>Fail2ban on Leopard Server</a> <small>So here I am running my own server &#8212; for...</small></li>
<li><a href='http://thefragens.com/blog/2010/11/checking-fail2ban-regex/' rel='bookmark' title='Checking Fail2ban regex'>Checking Fail2ban regex</a> <small>I&#8217;ve just stumbled across a great command in Fail2ban to...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://thefragens.com/blog/2010/12/fail2ban-problems-and-solutions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Checking Fail2ban regex</title>
		<link>http://thefragens.com/blog/2010/11/checking-fail2ban-regex/</link>
		<comments>http://thefragens.com/blog/2010/11/checking-fail2ban-regex/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 22:14:54 +0000</pubDate>
		<dc:creator>Andy Fragen</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[osx-server]]></category>
		<category><![CDATA[fail2ban]]></category>

		<guid isPermaLink="false">http://thefragens.com/blog/?p=811</guid>
		<description><![CDATA[I&#8217;ve just stumbled across a great command in Fail2ban to check whether or not your filter will actually score a hit from your log file. From the command line. fail2ban-regex /path/to/logfile /etc/fail2ban/filter.d/myfilter.conf regex_to_ignore As an example. fail2ban-regex /var/log/secure.log /etc/fail2ban/filter.d/sshd.conf (myusername&#124;myIPaddress) &#8230; <a href="http://thefragens.com/blog/2010/11/checking-fail2ban-regex/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://thefragens.com/blog/2010/12/fail2ban-problems-and-solutions/' rel='bookmark' title='Fail2ban Problems and Solutions'>Fail2ban Problems and Solutions</a> <small>If you use Fail2ban then you are probably aware of...</small></li>
<li><a href='http://thefragens.com/blog/2009/09/fail2ban-on-leopard-server/' rel='bookmark' title='Fail2ban on Leopard Server'>Fail2ban on Leopard Server</a> <small>So here I am running my own server &#8212; for...</small></li>
<li><a href='http://thefragens.com/blog/2010/11/fail2ban-and-os-x-server-part-deux/' rel='bookmark' title='Fail2ban and OS X Server, part deux'>Fail2ban and OS X Server, part deux</a> <small>As some of you might know I run my own...</small></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just stumbled across a great command in Fail2ban to check whether or not your filter will actually score a hit from your log file.</p>

<p>From the command line.</p>

<blockquote>
  <p><code>fail2ban-regex /path/to/logfile /etc/fail2ban/filter.d/myfilter.conf regex_to_ignore</code></p>
</blockquote>

<p>As an example.</p>

<blockquote>
  <p><code>fail2ban-regex /var/log/secure.log /etc/fail2ban/filter.d/sshd.conf (myusername|myIPaddress)</code></p>
</blockquote>

<p>This seems like a great way to test whether changes to your filters are correct, rather than just waiting to see if anything shows up in fail2ban.log.</p>
<p>Related posts:<ol>
<li><a href='http://thefragens.com/blog/2010/12/fail2ban-problems-and-solutions/' rel='bookmark' title='Fail2ban Problems and Solutions'>Fail2ban Problems and Solutions</a> <small>If you use Fail2ban then you are probably aware of...</small></li>
<li><a href='http://thefragens.com/blog/2009/09/fail2ban-on-leopard-server/' rel='bookmark' title='Fail2ban on Leopard Server'>Fail2ban on Leopard Server</a> <small>So here I am running my own server &#8212; for...</small></li>
<li><a href='http://thefragens.com/blog/2010/11/fail2ban-and-os-x-server-part-deux/' rel='bookmark' title='Fail2ban and OS X Server, part deux'>Fail2ban and OS X Server, part deux</a> <small>As some of you might know I run my own...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://thefragens.com/blog/2010/11/checking-fail2ban-regex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Printopia</title>
		<link>http://thefragens.com/blog/2010/11/printopia/</link>
		<comments>http://thefragens.com/blog/2010/11/printopia/#comments</comments>
		<pubDate>Wed, 24 Nov 2010 21:45:36 +0000</pubDate>
		<dc:creator>Andy Fragen</dc:creator>
				<category><![CDATA[osx-server]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://thefragens.com/blog/?p=806</guid>
		<description><![CDATA[AirPrint is one of the most welcome additions of late to iOS 4.2. Unfortunately Apple removed the ability to print to shared printers. Fortunately, creative software developers such as Ecamm have created Printopia as a solution for those of us &#8230; <a href="http://thefragens.com/blog/2010/11/printopia/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://thefragens.com/blog/2008/12/subscribing-to-delegated-calendars/' rel='bookmark' title='Subscribing to Delegated Calendars'>Subscribing to Delegated Calendars</a> <small>OK, I&#8217;m fortunate or crazy enough to run my own...</small></li>
<li><a href='http://thefragens.com/blog/2010/05/false-positive/' rel='bookmark' title='False Positive'>False Positive</a> <small>Just a personal reminder to keep in the memory bank....</small></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>AirPrint is one of the most welcome additions of late to iOS 4.2. Unfortunately Apple removed the ability to print to shared printers. Fortunately, creative software developers such as Ecamm have created <a href="http://www.ecamm.com/mac/printopia/index.html">Printopia</a> as a solution for those of us with networked or shared printers.</p>

<p>The simplicity of this Preference Pane is amazing. It takes less than a minute to setup and use.</p>

<p>The only problem I found was when installed on my server I had to open port 49195 in my firewall for it to work. Now all is well again. I can&#8217;t recommend this $10 piece of software enough.</p>
<p>Related posts:<ol>
<li><a href='http://thefragens.com/blog/2008/12/subscribing-to-delegated-calendars/' rel='bookmark' title='Subscribing to Delegated Calendars'>Subscribing to Delegated Calendars</a> <small>OK, I&#8217;m fortunate or crazy enough to run my own...</small></li>
<li><a href='http://thefragens.com/blog/2010/05/false-positive/' rel='bookmark' title='False Positive'>False Positive</a> <small>Just a personal reminder to keep in the memory bank....</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://thefragens.com/blog/2010/11/printopia/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fail2ban and OS X Server, part deux</title>
		<link>http://thefragens.com/blog/2010/11/fail2ban-and-os-x-server-part-deux/</link>
		<comments>http://thefragens.com/blog/2010/11/fail2ban-and-os-x-server-part-deux/#comments</comments>
		<pubDate>Thu, 04 Nov 2010 22:10:39 +0000</pubDate>
		<dc:creator>Andy Fragen</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[osx-server]]></category>
		<category><![CDATA[dovecot]]></category>
		<category><![CDATA[fail2ban]]></category>
		<category><![CDATA[snow-leopard]]></category>

		<guid isPermaLink="false">http://thefragens.com/blog/?p=788</guid>
		<description><![CDATA[As some of you might know I run my own installation of OS X Server. I&#8217;ve since updated it to Snow Leopard Server and I think I&#8217;ve got most of it running well. As I check my server logs frequently &#8230; <a href="http://thefragens.com/blog/2010/11/fail2ban-and-os-x-server-part-deux/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://thefragens.com/blog/2010/11/checking-fail2ban-regex/' rel='bookmark' title='Checking Fail2ban regex'>Checking Fail2ban regex</a> <small>I&#8217;ve just stumbled across a great command in Fail2ban to...</small></li>
<li><a href='http://thefragens.com/blog/2009/09/fail2ban-on-leopard-server/' rel='bookmark' title='Fail2ban on Leopard Server'>Fail2ban on Leopard Server</a> <small>So here I am running my own server &#8212; for...</small></li>
<li><a href='http://thefragens.com/blog/2010/12/fail2ban-problems-and-solutions/' rel='bookmark' title='Fail2ban Problems and Solutions'>Fail2ban Problems and Solutions</a> <small>If you use Fail2ban then you are probably aware of...</small></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>As some of you might know I run my own installation of OS X Server. I&#8217;ve since updated it to Snow Leopard Server and I think I&#8217;ve got most of it running well. As I check my server logs frequently I find that there are all sorts of script kiddies attempting to log in to my server in various ways.</p>

<p>The traditional method was to simply try an ssh session with a username and password combination. Unfortunately now I see more attempts to log in via VNC or in attempts to <em>check</em>  or <em>send</em> email. It&#8217;s amazing to see 10 - 15 login attempts in a second. There&#8217;s a real motivating force to stop that kind of attention my poor little server is getting.</p>

<p><a href="http://thefragens.com/blog/tag/fail2ban/">As I&#8217;ve written before</a>, I&#8217;ve found the <a href="http://www.fail2ban.org/wiki/index.php/Main_Page">Fail2ban</a> scripts to to be a perfect solution. I have had to make a number of additions and <em>improvements</em> along the way and now I thought I&#8217;d share.</p>

<p>I&#8217;ve created a couple of new jails and improved upon a couple of the distribution jails so they work better with Snow Leopard. <a href="http://thefragens.com/pub/install_fail2ban_mods.tar.gz">I&#8217;ve packaged up all my modifications.</a> Here&#8217;s how to install them for yourself.</p>

<p><a href="http://thefragens.com/pub/install_fail2ban_mods.tar.gz">Download</a> the modifications tarbell.</p>

<p>Then you&#8217;ll need to issue the following commands from Terminal.</p>

<pre><code>sudo tar xzf install_fail2ban_mods.tar.gz
</code></pre>

<p>This will create a folder containing all the modifications. At this point you can manually put all the files in the proper folders or you can use my installation script. The installation script, <code>install_fail2ban_mod.sh</code> shouldn&#8217;t delete anything. I only use the <code>cp</code> command. If you already have a <code>jail.local</code> file that is backed up. You may also need to modify the <code>jail.local</code> file that I have.</p>

<p>Additionally, I&#8217;ve found that sometimes the fail2ban server might have hung or its process has stopped. I&#8217;ve also written a script and a couple of plists for <code>/Library/LaunchDaemons/</code> that periodically check to make sure fail2ban continues to hum along. You&#8217;ll have to load these plists manually or simply restart.</p>

<p>The jails that I&#8217;ve added check for SMTP, POP, IMAP, VNC and non-existant web pages. These, in addition to monitoring SSH, seem to cover most of it. Please remember that some of these filters are somewhat specific to Snow Leopard so they check against a Dovecot mail server.</p>

<p>So far my only problem has been when a user has changed their password but not correctly transferred these changes to Mail.app. What happens is fail2ban sees them as a break-in attempt and bans their IP for 10 minutes or so. I&#8217;m sure it can be frustrating. Sorry, I&#8217;m doing my best to fix it for you.</p>

<p>By all means, let me know how you&#8217;ve improved Fail2ban for your server.</p>
<p>Related posts:<ol>
<li><a href='http://thefragens.com/blog/2010/11/checking-fail2ban-regex/' rel='bookmark' title='Checking Fail2ban regex'>Checking Fail2ban regex</a> <small>I&#8217;ve just stumbled across a great command in Fail2ban to...</small></li>
<li><a href='http://thefragens.com/blog/2009/09/fail2ban-on-leopard-server/' rel='bookmark' title='Fail2ban on Leopard Server'>Fail2ban on Leopard Server</a> <small>So here I am running my own server &#8212; for...</small></li>
<li><a href='http://thefragens.com/blog/2010/12/fail2ban-problems-and-solutions/' rel='bookmark' title='Fail2ban Problems and Solutions'>Fail2ban Problems and Solutions</a> <small>If you use Fail2ban then you are probably aware of...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://thefragens.com/blog/2010/11/fail2ban-and-os-x-server-part-deux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting up Snow Leopard iCal Server</title>
		<link>http://thefragens.com/blog/2010/08/setting-up-snow-leopard-ical-server/</link>
		<comments>http://thefragens.com/blog/2010/08/setting-up-snow-leopard-ical-server/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 20:15:16 +0000</pubDate>
		<dc:creator>Andy Fragen</dc:creator>
				<category><![CDATA[mac-osx]]></category>
		<category><![CDATA[osx-server]]></category>
		<category><![CDATA[ical-server]]></category>

		<guid isPermaLink="false">http://thefragens.com/blog/?p=761</guid>
		<description><![CDATA[After scouring through the official documentation, and finding that lacking, Google has found the answers. Make sure Wiki Server is set to 127.0.0.1 and that Use SSL is checked. Here&#8217;s how I was finally able to get my groups into &#8230; <a href="http://thefragens.com/blog/2010/08/setting-up-snow-leopard-ical-server/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://thefragens.com/blog/2010/08/snow-leopard-sieve-rules/' rel='bookmark' title='Snow Leopard Sieve Rules'>Snow Leopard Sieve Rules</a> <small>How to edit sieve rules in Snow Leopard by hand....</small></li>
<li><a href='http://thefragens.com/blog/2008/12/subscribing-to-delegated-calendars/' rel='bookmark' title='Subscribing to Delegated Calendars'>Subscribing to Delegated Calendars</a> <small>OK, I&#8217;m fortunate or crazy enough to run my own...</small></li>
<li><a href='http://thefragens.com/blog/2008/08/ical-exchange-time-zone-fix-part-2/' rel='bookmark' title='iCal - Exchange Time Zone Fix - part 2'>iCal - Exchange Time Zone Fix - part 2</a> <small>I&#8217;ve come across a problem with the original MailExchange2iCal-TZ-fix script....</small></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>After scouring through the official documentation, and finding that lacking, Google has found the answers.</p>

<p>Make sure <em>Wiki Server</em> is set to <strong>127.0.0.1</strong> and that <em>Use SSL</em> is checked. </p>

<p>Here&#8217;s how I was finally able to get my groups into iCal SL/Lion client (<strong>no SSL</strong>)</p>

<blockquote>
  <p><code>userName</code><br />
  <code>password</code><br />
  <code>server.com/principals/__uids__/wiki-groupName/</code> (no http://)</p>
</blockquote>

<p>To get this group calendar into iOS add the following as a CalDAV calendar.</p>

<blockquote>
  <p><code>username</code><br />
  <code>password</code><br />
  <code>server.com/principals/wikis/groupname/</code> (no http://)</p>
</blockquote>
<p>Related posts:<ol>
<li><a href='http://thefragens.com/blog/2010/08/snow-leopard-sieve-rules/' rel='bookmark' title='Snow Leopard Sieve Rules'>Snow Leopard Sieve Rules</a> <small>How to edit sieve rules in Snow Leopard by hand....</small></li>
<li><a href='http://thefragens.com/blog/2008/12/subscribing-to-delegated-calendars/' rel='bookmark' title='Subscribing to Delegated Calendars'>Subscribing to Delegated Calendars</a> <small>OK, I&#8217;m fortunate or crazy enough to run my own...</small></li>
<li><a href='http://thefragens.com/blog/2008/08/ical-exchange-time-zone-fix-part-2/' rel='bookmark' title='iCal - Exchange Time Zone Fix - part 2'>iCal - Exchange Time Zone Fix - part 2</a> <small>I&#8217;ve come across a problem with the original MailExchange2iCal-TZ-fix script....</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://thefragens.com/blog/2010/08/setting-up-snow-leopard-ical-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dovecot Permissions</title>
		<link>http://thefragens.com/blog/2010/08/dovecot-permissions/</link>
		<comments>http://thefragens.com/blog/2010/08/dovecot-permissions/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 15:42:37 +0000</pubDate>
		<dc:creator>Andy Fragen</dc:creator>
				<category><![CDATA[mac-osx]]></category>
		<category><![CDATA[osx-server]]></category>
		<category><![CDATA[dovecot]]></category>

		<guid isPermaLink="false">http://thefragens.com/blog/?p=738</guid>
		<description><![CDATA[Well, I finally bit the bullet and installed OS X Snow Leopard Server. Most of what I absolutely need to get working is mail services. One of the peculiarities of Dovecot is that each users mail folder is owned by &#8230; <a href="http://thefragens.com/blog/2010/08/dovecot-permissions/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://thefragens.com/blog/2010/11/fail2ban-and-os-x-server-part-deux/' rel='bookmark' title='Fail2ban and OS X Server, part deux'>Fail2ban and OS X Server, part deux</a> <small>As some of you might know I run my own...</small></li>
<li><a href='http://thefragens.com/blog/2010/05/server-side-email-filtering-with-sieve/' rel='bookmark' title='Server-Side Email Filtering with Sieve'>Server-Side Email Filtering with Sieve</a> <small>Another post for the peripheral brain. When I first set...</small></li>
<li><a href='http://thefragens.com/blog/2008/03/fixing-cyrus/' rel='bookmark' title='Fixing cyrus'>Fixing cyrus</a> <small>Yeah, I did something stupid and had to reinstall my...</small></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Well, I finally bit the bullet and installed OS X Snow Leopard Server. Most of what I absolutely <strong>need</strong> to get working is mail services. One of the peculiarities of Dovecot is that each users mail folder is owned by that user. I think in Cyrus they were all owned by <em>mail</em> or <em>_cyrus</em>.</p>

<p>Anyway, I found that a couple of my files didn&#8217;t have the correct permissions and I found out by trying to open in webmail. It gave me errors I&#8217;d never seen before. Where I found better errors was in mailaccess.log where I saw a <em>dovecot</em> service with a <em>failed: Permission denied</em> error.</p>

<p>I managed to find where the files lived and as I have quite a few mail users I didn&#8217;t want to go through individually so I figured out a script to do it.</p>

<blockquote>
  <p><code>sudo ls -lA /var/spool/imap/dovecot/mail | grep -v total | awk {'printf $3": /var/spool/imap/dovecot/mail/"$9"\n"'} | xargs -n2 -p sudo chown -R</code></p>
</blockquote>

<p>The script will ask if you want to proceed with the <em>chown</em> command for each user.</p>

<p>If you find your logs reporting permissions issues with a specific account or your webmail users have errors opening mailboxes, then the following script when provided with the offending GeneratedUID will reset the permissions similar to the above. Simply replace the GUID in the script with the one listed in your logs.</p>

<blockquote>
  <p><code>dscl /LDAPv3/127.0.0.1 -list /Users GeneratedUID | grep GUID | awk {'printf $1": /var/spool/imap/dovecot/mail/"$2"\n"'} | xargs -n2 -p sudo chown -R</code></p>
</blockquote>
<p>Related posts:<ol>
<li><a href='http://thefragens.com/blog/2010/11/fail2ban-and-os-x-server-part-deux/' rel='bookmark' title='Fail2ban and OS X Server, part deux'>Fail2ban and OS X Server, part deux</a> <small>As some of you might know I run my own...</small></li>
<li><a href='http://thefragens.com/blog/2010/05/server-side-email-filtering-with-sieve/' rel='bookmark' title='Server-Side Email Filtering with Sieve'>Server-Side Email Filtering with Sieve</a> <small>Another post for the peripheral brain. When I first set...</small></li>
<li><a href='http://thefragens.com/blog/2008/03/fixing-cyrus/' rel='bookmark' title='Fixing cyrus'>Fixing cyrus</a> <small>Yeah, I did something stupid and had to reinstall my...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://thefragens.com/blog/2010/08/dovecot-permissions/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

