<?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>Anthony's Blog &#187; howto</title>
	<atom:link href="http://www.anthonyldechiaro.com/blog/archives/category/howto/feed" rel="self" type="application/rss+xml" />
	<link>http://www.anthonyldechiaro.com/blog</link>
	<description>Thoughts, ideas, and ramblings of a crazed mind</description>
	<lastBuildDate>Fri, 05 Jun 2009 00:01:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Remote monitoring with apticron and logcheck</title>
		<link>http://www.anthonyldechiaro.com/blog/archives/272</link>
		<comments>http://www.anthonyldechiaro.com/blog/archives/272#comments</comments>
		<pubDate>Tue, 10 Mar 2009 19:27:13 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[admin]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[reporting]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.anthonyldechiaro.com/blog/?p=272</guid>
		<description><![CDATA[I wanted to write a brief posting on some basic ways to help remotely administer Ubuntu/Debian boxes.  Over the past few months I&#8217;ve been tinkering with various methods of handling this and what I&#8217;ve come up with seems to work fairly well.  It basically consists of two applications: apticron, which monitors repositories for package updates, [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">I wanted to write a brief posting on some basic ways to help remotely administer Ubuntu/Debian boxes.  Over the past few months I&#8217;ve been tinkering with various methods of handling this and what I&#8217;ve come up with seems to work fairly well.  It basically consists of two applications: apticron, which monitors repositories for package updates, and logcheck, which monitors logs in for any security or other noteworthy entries.</p>
<p style="text-align: justify;">Apticron is very easy to set up, it&#8217;s in the repositories and requires basically no configuration.  It will drop a script in /etc/cron.daily and that is about it, emailing any reports to root.  Of course this can be modified through a .forward or an entry in /etc/aliases.</p>
<p style="text-align: justify;">Logcheck is fairly simple to set up as well &#8211; it is also in the repositories.  Once installed, edit the /etc/logcheck/logcheck.conf file to configure.  The first thing you will want to set is the REPORTLEVEL setting, options are &#8220;workstation&#8221;, &#8220;server&#8221; (default value), or &#8220;paranoid&#8221;.  I use server on mine, which gives a good amount of detail. I would advise against using paranoid unless the server is extremely locked down and users do not typically login.  Workstation is good for a desktop environment.  The only other variable I edited was SENDMAILTO.  Logcheck works by basically comparing each  logentry against a set of regular expressions and generate a report if it does not match.  I had to modify one or two regex&#8217;s slightly to fix false positives, if you want my changes just ask and I&#8217;ll send them over.</p>
<p style="text-align: justify;">One other small gem I want to mention : <a href="http://members.dslextreme.com/users/billw/gkrellm/gkrellm.html" target="_blank">gkrellm</a>.  I use this on both my desktop and server, it is invaluable for providing real-time system performance metrics.  Sure, it does not have any logging capabilities and thus unsuitable in a large-scale environment but for keeping an eye on one or two boxes it fits the bill quite nicely.</p>
 <img src="http://www.anthonyldechiaro.com/blog/wp-content/plugins/feed-statistics.php?view=1&post_id=272" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.anthonyldechiaro.com/blog/archives/272/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rsync script update</title>
		<link>http://www.anthonyldechiaro.com/blog/archives/182</link>
		<comments>http://www.anthonyldechiaro.com/blog/archives/182#comments</comments>
		<pubDate>Tue, 16 Dec 2008 15:06:05 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[admin]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://www.anthonyldechiaro.com/blog/?p=182</guid>
		<description><![CDATA[I&#8217;ve been using my rsync mirror script for a few weeks now and have implemented an additional one or two tweaks after deploying it on my desktop system as well.

Firstly, now you can you use the same script across multiple boxes &#8211; the UUIDs are configurable per hostname
A bug was fixed where the script would [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">I&#8217;ve been using my <a href="/blog/archives/11">rsync mirror script</a> for a few weeks now and have implemented an additional one or two tweaks after deploying it on my desktop system as well.</p>
<ul style="text-align: justify;">
<li>Firstly, now you can you use the same script across multiple boxes &#8211; the UUIDs are configurable per hostname</li>
<li>A bug was fixed where the script would fail if the destination disks were not already mounted.</li>
<li>You can also customize the rsync invocation on a host-basis as well.  This was needed on my desktop machine where a /home account was mounted via NFS on a different file system causing IO errors and subsequently skipping the file deletion.</li>
</ul>
<p style="text-align: justify;">One final enhancement I want to add is the ability to spin the backup disk down after rsync is complete &#8211; this will not only help to increase drive life but also help reduce power use (however small it may be).  For some odd reason on my machines whenever I stop (umount, sync, then spin-down) an internal disk it works for a few seconds, then the drive spins back up again and I&#8217;m seeing ATA link reset messages as if it was just being plugged in.  External drives connected with eSATA seem to work just fine however.  Need to look into that more.</p>
<p style="text-align: justify;">Also shortly available:</p>
<ul style="text-align: justify;">
<li>A similar but different script I use for syncing my RAID storage array with an backup external drive connected via eSATA.  It&#8217;s a bit of a hack in some spots, but the nice thing is that it is almost fully automated.  Use this on a machine with one of those <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16817153071">eSATA docks</a> and you have a good way of making a quick backup of an array or disk.</li>
<li>Sample <a href="/blog/archives/150">service account</a> script implementation with the &#8216;chattr&#8217; command.</li>
</ul>
<p style="text-align: justify;"><a href="http://www.anthonyldechiaro.com/files/master_sync_root.sh">Download</a> or <a href="http://wiki.anthonyldechiaro.com/tiki-index.php?page=master_sync_root">wiki</a>.</p>
 <img src="http://www.anthonyldechiaro.com/blog/wp-content/plugins/feed-statistics.php?view=1&post_id=182" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.anthonyldechiaro.com/blog/archives/182/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Simple key-based SSH + service account HOWTO</title>
		<link>http://www.anthonyldechiaro.com/blog/archives/150</link>
		<comments>http://www.anthonyldechiaro.com/blog/archives/150#comments</comments>
		<pubDate>Thu, 04 Dec 2008 05:02:42 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[admin]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[public keys]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.anthonyldechiaro.com/blog/?p=150</guid>
		<description><![CDATA[If you have read my brief posting Intrepid upgrade done I mentioned I would shorlty be implementing SSH keys for my systems.  This is a simple HOWTO to cover the steps I used.  In my case I&#8217;m implementing this only a small home network, please adjust as needed.  I will be setting up a key [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">If you have read my brief posting <a href="/blog/archives/130">Intrepid upgrade done</a> I mentioned I would shorlty be implementing SSH keys for my systems.  This is a simple HOWTO to cover the steps I used.  In my case I&#8217;m implementing this only a small home network, please adjust as needed.  I will be setting up a key for my primary user account plus an additional phrase-less key used for automation purposes.  This second key will act as a service account, restricted to running only a few particular applications and/or scripts.</p>
<ol>
<li style="text-align: justify;">Run <span style="text-decoration: underline;">ssh-keygen -t rsa</span>.  I specified a simple passphrase for general-purpose logins.  We will be adding the second phrase-less key later.
<pre>(adechiaro@desktop:pts/6)-(4/0 @ 17k)-(09:22 PM)
~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/adechiaro/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_rsa.
Your public key has been saved in id_rsa.pub.
The key fingerprint is:
5d:34:f1:de:ad:be:ef:65:34:36:a4:0d:75:d6:3c:47 adechiaro@desktop
The key's randomart image is:
+--[ RSA 2048]----+
...
+-----------------+
(adechiaro@desktop:pts/6)-(4/0 @ 17k)-(9:22 PM)
~$ cat .ssh/id_rsa.pub
ssh-rsa &lt;key&gt; adechiaro@desktop</pre>
</li>
<li style="text-align: justify;">Any machine you want to be able to connect to with this key, login and copy the contents of your public key (<span style="text-decoration: underline;">id_rsa.pub</span>) to the <span style="text-decoration: underline;">authorized_keys</span> file.  These are all in your <span style="text-decoration: underline;">$HOME/.ssh/</span> directory.  There are various ways to do this: you could copy the file over with scp and cat/append it, you could remote in to the host and cut &amp; paste the data, if you had a large infrastructure you could use ssh-copy-id or similar custom script.  It&#8217;s up to you, something like what is below should work in the general case.  Also the &lt;key&gt; is your public key in base64 encoded format.
<pre>desktop:~$ scp .ssh/id_rsa.pub adechiaro@server:~
id_service.pub                           100%  399     0.4KB/s   00:00
desktop:~$ ssh adechiaro@server
server:~$ cat id_rsa.pub &gt;&gt; ~/.ssh/authorized_keys</pre>
</li>
<li style="text-align: justify;">Now for an example of making the key more secure, you can add additional options to the <span style="text-decoration: underline;">authorized_keys</span> file.  These come before the &#8220;ssh-rsa &lt;key&gt;&#8221; part of the entry (prefix the line with them): <span id="more-150"></span>
<ol>
<li><strong>from=&#8221;host1,host2,10.0.0.1&#8243; &#8211; </strong>This will prevent the key from authenticating except the hosts listed here, canonical name or IP.</li>
<li><strong>command=&#8221;/usr/local/bin/myscript.sh&#8221;, no-pty</strong> &#8211; Executes <strong>command</strong> upon login.  You might want to combine this with <strong>no-pty</strong> which prevents tty allocation (shell login) so you can securely execute a remote command and without granting direct login access (we will be doing this for our service account)</li>
<li>There are <strong><em>a lot</em></strong> of more options &#8211; read the sshd manpage under the authorized_keys section for more.</li>
</ol>
</li>
<li>Create the second public key saved with a different name.  Leave this with an empty passphrase as will be used for automation.
<pre>ssh-keygen -f id_service</pre>
</li>
<li style="text-align: justify;">You will need to either write a simple script or use an existing one for linking with this key.  This will be run every time the account is logged into, regardless of what command may be passed on the SSH command line (the command line arguments will be read by the script but not necessarily executed).  Here is a simple generic one I threw together for general purpose use (<a href="/files/service.sh">download</a> or <a href="http://wiki.anthonyldechiaro.com/tiki-index.php?page=service.sh">view in wiki</a>).   I do not make any promises this is completely bugfree/secure nor am I liable for any consequences!  If you use mine, you will want to configure the COMMANDS variable within the script.  These are the specific commands which the service account will be permitted to run.  A command specified on the SSH command line which does not match any entry in COMMANDS will not be run.  Also, make sure the file is <span style="text-decoration: underline;"><strong>chmod 500</strong></span> after you are done configuring it, it&#8217;s basically a homebrew sudoers file and vital no other users can read the contents.</li>
<li style="text-align: justify;">Copy your second key to the other machines as in step 2.  You will want to to prefix this new entry with <strong>&#8216;command=&#8221;/usr/local/bin/service.sh&#8221;, no-pty&#8217;</strong>, adjusting the path and script name as needed.  You may also want to specify <strong>&#8216;no-port-forwarding,no-X11-forwarding&#8217;</strong> as additional security measures.</li>
<li style="text-align: justify;">Done!</li>
</ol>
<p>Now to run, simply connect via ssh.  It will default to your id_rsa key:</p>
<pre>desktop:~$ ssh adechiaro@server
Enter passphrase for key '/home/adechiaro/.ssh/id_rsa':
server:~$</pre>
<p>If you want to use your service account in a script, call it in the following manner:</p>
<pre>desktop:~$ ssh adechiaro@server -i ~/.ssh/id_service /usr/bin/whoami
Executing command: "/usr/bin/whoami"
adechiaro
desktop:~$ ssh adechiaro@server -i ~/.ssh/id_service /bin/hostname
Executing command: "/bin/hostname"
server
desktop:~$</pre>
<p style="text-align: justify;">We need to specify the full path to the key in this case.  Replace whoami or hostname with whatever script/app you want to run and assuming you pre-configured it the service.sh script correctly, it should run just fine without prompting you for the passphrase.  Please feel free to leave any question and/or comments.</p>
<h5 style="text-align: justify;"><span style="text-decoration: underline;"><strong>References:</strong></span></h5>
<h5 style="text-align: justify;"><a href="http://www.securityfocus.com/infocus/1810">http://www.securityfocus.com/infocus/1810</a><br />
<a href="http://standalone-sysadmin.blogspot.com/2008/11/host-to-host-security-with-ssh-keys.html">http://standalone-sysadmin.blogspot.com/2008/11/host-to-host-security-with-ssh-keys.html</a><br />
<a href="http://standalone-sysadmin.blogspot.com/2008/11/wacky-ssh-authorized-keys-tricks.htm">http://standalone-sysadmin.blogspot.com/2008/11/wacky-ssh-authorized-keys-tricks.htm</a>l<br />
<a href="http://it.toolbox.com/blogs/unix-sysadmin/playing-with-openssh-public-keys-28377">http://it.toolbox.com/blogs/unix-sysadmin/playing-with-openssh-public-keys-28377</a><br />
<a href="http://blog.funnelfiasco.com/?p=44">http://blog.funnelfiasco.com/?p=44</a></h5>
 <img src="http://www.anthonyldechiaro.com/blog/wp-content/plugins/feed-statistics.php?view=1&post_id=150" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.anthonyldechiaro.com/blog/archives/150/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My .screenrc</title>
		<link>http://www.anthonyldechiaro.com/blog/archives/125</link>
		<comments>http://www.anthonyldechiaro.com/blog/archives/125#comments</comments>
		<pubDate>Sat, 15 Nov 2008 08:40:46 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[admin]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[screen]]></category>

		<guid isPermaLink="false">http://www.anthonyldechiaro.com/blog/?p=125</guid>
		<description><![CDATA[Just thought it might be useful posting the contents of my .screenrc file. I&#8217;ll go over it in some basic detail.
escape ^&#124;&#124;
msgwait 2

altscreen on
autodetach on
defscrollback 4000
startup_message off

# Message/bell/activity info
vbell off
vbell_msg " *beep* "
sorendition "+b kG"
bell "%c:bell -&#62; %n%f %t^G"
activity "%c activity -&#62; %n%f %t"

# Don't block screen session waiting for unresponsive window
nonblock on

hardstatus alwayslastline '%{= [...]]]></description>
			<content:encoded><![CDATA[<p>Just thought it might be useful posting the contents of my .screenrc file. I&#8217;ll go over it in some basic detail.</p>
<pre>escape ^||
msgwait 2

altscreen on
autodetach on
defscrollback 4000
startup_message off

# Message/bell/activity info
vbell off
vbell_msg " *beep* "
sorendition "+b kG"
bell "%c:bell -&gt; %n%f %t^G"
activity "%c activity -&gt; %n%f %t"

# Don't block screen session waiting for unresponsive window
nonblock on

hardstatus alwayslastline '%{= gk}%-Lw%{= rW}%50&gt; %n%f* %t %{-}%+Lw%&lt; %= %{= kG} %H %{= Bw} %l %{= kG} %Y-%m-%d %c %{g}' 

# Window number starts at 1, not 0
bind 'q' quit
bind c screen 1
bind 0 select 10

# Tell screen that you term can scroll and bind Shift+PgUp/PgDn
termcapinfo xterm ti@:te@
bindkey -m "^[[5;2~" stuff ^b
bindkey -m "^[[6;2~" stuff ^f

# Setup our default apps
screen -t htop 1 htop
screen -t iptraf 2 nice sudo iptraf
screen -t messages -M 3 tail -n 2000 -F /var/log/messages
screen 4 bash
select 1</pre>
<p style="text-align: justify;">OK, so firstly I like using Ctrl-Pipe for some reason &#8211; &#8216;^|&#8217;  I set some initial startup parameters, autodetach useful in case you need to kill X for some reason.  Then is the bell &amp; activity customizations, nothing special to look at here.  My hardstatus is something I threw together based upon several I&#8217;ve seen online and the custom one I wrote for work.  I configured it to start numbering with &#8216;1&#8242; instead of &#8216;0&#8242; for window numbers and for xterm to recognize scrolling with my mousewheel.  Final section is just setting up some default windows.  I found the &#8216;-F&#8217; flag to be vital versus the typical lowercase &#8216;-f&#8217;, as it implies &#8216;&#8211;retry&#8217;.  This is needed due to log rotation, it will force tail to retry opening file upon failure.  Otherwise once the file gets rotated, output from tail will just stop.</p>
<p>Screenshots:</p>
<p><a href="http://www.anthonyldechiaro.com/files/screen1.png"><img class="alignleft" src="http://www.anthonyldechiaro.com/files/screen1.png" alt="" width="160" height="131" /></a><a href="http://www.anthonyldechiaro.com/files/screen2.png"><img class="alignleft" src="http://www.anthonyldechiaro.com/files/screen2.png" alt="" width="160" height="132" /></a></p>
 <img src="http://www.anthonyldechiaro.com/blog/wp-content/plugins/feed-statistics.php?view=1&post_id=125" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.anthonyldechiaro.com/blog/archives/125/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postfix Authenticated SMTP Relayhost</title>
		<link>http://www.anthonyldechiaro.com/blog/archives/71</link>
		<comments>http://www.anthonyldechiaro.com/blog/archives/71#comments</comments>
		<pubDate>Fri, 17 Oct 2008 12:43:15 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[admin]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[relaying]]></category>
		<category><![CDATA[smtp]]></category>

		<guid isPermaLink="false">http://www.anthonyldechiaro.com/blog/?p=71</guid>
		<description><![CDATA[Setting up a authenticated SMTP relayhost with Postfix on Ubuntu.]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">This question stumped me for awhile several years back, at the time I was working from home and my ISP would block SMTP relaying to any host other then their own (as most typically do).  I already had a free <a href="http://www.dyndns.com/services/dns/dyndns/" target="_blank">Dynamic DNS</a> account with DynDNS  and decided to add their inexpensive <a href="http://www.dyndns.com/services/mailhop/outbound.html">Mailhop Outbound</a> service which worked great and solved all my problems for a whole $15/year<strong>*</strong>.  Thinking about it more I figured it would be make sense to utilize it further and have my Linux server relay any emails to my cellphone/Blackberry, especially any mdadm monitoring alerts for my RAID-5 array.  However I was having difficulting locating quality documentation configuring relayhost SMTP authentication in sendmail.  It&#8217;s a simple setup now with Postfix (and probably sendmail too), but at the time I was running Fedora Core and just switched to the brand-new Warty release (I wasn&#8217;t kidding when I said some time ago).</p>
<p style="text-align: left;">Here are some basic configuration steps.  We will be using <span style="text-decoration: underline;">mail.myrelayhost.com</span> and testing delivery to <span style="text-decoration: underline;">bob@aol.com</span> as an example.  I have not tested this with DynDNS relaying in some time now but I see no reason that would prevent it from working if you use their service.  <strong><span style="text-decoration: underline;">Note</span></strong>: These commands must be run with root permissions via sudo.</p>
<p style="text-align: left;"><span id="more-71"></span></p>
<p style="text-align: left;"><strong><span style="text-decoration: underline;">Configuration</span></strong></p>
<ol>
<li>Setup a password maps file <span style="text-decoration: underline;">/etc/postfix/sasl_passwd</span> with the following:
<pre>mail.myrelayhost.com    username:password</pre>
</li>
<li>Secure it with the following:
<pre>chown root:root /etc/postfix/sasl_passwd
chmod 600 /etc/postfix/sasl_passwd
postmap /etc/postfix/sasl_passwd</pre>
</li>
<li>Edit <span style="text-decoration: underline;">/etc/postfix/main.cf</span>, adding/or editing the following:
<pre>relayhost = mail.myrelayhost.com:port
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd</pre>
<p>You can also edit <span style="text-decoration: underline;">/etc/mailname</span> to change the domain/hostname outbound emails appeared to be delivered from (assuming main.cf has an entry &#8220;myorigin = /etc/mailname&#8221; which should be there by default)</li>
<li>Reload postfix: [ postfix reload ]</li>
<li>SASL libraries may need to be installed.  On my Hardy machines, I have the following packages installed:
<pre>root@eternal:~# dpkg -l *sasl* | grep -G '^ii'
ii  libgsasl7                                 0.2.21-1                            GNU SASL library
ii  libsasl2-2                                2.1.22.dfsg1-18ubuntu2              Cyrus SASL - authentication abstraction libr
ii  libsasl2-modules                          2.1.22.dfsg1-18ubuntu2              Cyrus SASL - pluggable authentication module</pre>
</li>
<li><strong>Optional:</strong> Since we are going this far it makes sense to configure <span style="text-decoration: underline;">/etc/aliases</span> as well.  This will allow us to forward the mail delivered to a local user to an external address instead:
<pre>root@eternal:~# cat /etc/aliases
# Added by installer for initial user
root:   rigel@mydomain.net
adechiaro:  adechiaro@mydomain.net</pre>
</li>
</ol>
<p><span style="text-decoration: underline;"><strong>Testing/Debugging Steps</strong></span></p>
<ol>
<li>Check to see if Postfix recognizes your password maps (should return your username/password):
<pre>postmap -q mail.myrelayhost.com /etc/postfix/sasl_passwd</pre>
</li>
<li style="text-align: justify;">Do a basic outbound email delivery test to a working email account:
<pre>echo "relaying works!" | mailx bob@aol.com</pre>
<p>Check /var/log/mail.log (or similar) to see if the message was delivered correctly:</p>
<pre>Oct 18 13:01:04 eternal postfix/pickup[6410]: A88AF25E79: uid=1000 from=&lt;anthony&gt;
Oct 18 13:01:04 eternal postfix/cleanup[6507]: A88AF25E79: message-id=&lt;20081025170104.A88AF25E79@eternal&gt;
Oct 18 13:01:04 eternal postfix/qmgr[6411]: A88AF25E79: from=&lt;anthony@eternal&gt;, size=397, nrcpt=1 (queue active)
Oct 18 13:01:05 eternal postfix/smtp[6521]: A88AF25E79: to=&lt;bob@aol.com&gt;, relay=myrelayhost.com[208.67.217.132]:25, delay=0.55, delays=0.03/0.01/0.22/0.29, dsn=2.0.0, status=sent (250 OK id=1KtmVL-0000ol-RU)
Oct 18 13:01:05 eternal postfix/qmgr[6411]: A88AF25E79: removed</pre>
</li>
<li style="text-align: justify;">If getting SASL authentication errors, check your postfix options (either postconf command or main.cf file).  By default Postfix will not send cleartext passwords.  If your host only allows PLAIN or LOGIN methods, you will need to remove noplaintext from the SASL security options:
<pre>postconf -e smtp_sasl_security_options=noanonymous
postfix reload</pre>
</li>
<li>If you are using GMail SMTP (or other large-scale host which uses load balancing) I&#8217;ve read the following might be necessary:
<pre>postconf -e smtp_cname_overrides_servername=no</pre>
<p style="text-align: justify;">If this resolves the problem, it&#8217;s due to the fact the server you specify in sasl_passwd might actually get delivered to a server with a different hostname.  Port 587 may be necessary for GMail as well.</p>
</li>
</ol>
<h6><strong><strong>*No affiliation with DynDNS, except for being a satified customer</strong></strong></h6>
<p><span style="text-decoration: underline;"><strong>Update (Nov 02):</strong></span> I also found an application called ssmtp which does a similar thing, it may be easier to configure and use although I have no experience with it.  You can see how to configure it <a title="how to configure ssmtp" href="http://tombuntu.com/index.php/2008/10/21/sending-email-from-your-system-with-ssmtp/">here</a>.<strong> </strong></p>
<p><span style="text-decoration: underline;"><strong>Update 2 (Nov 12):</strong></span> Just recently saw an <a href="http://ubuntu-tutorials.com/2008/11/11/relaying-postfix-smtp-via-smtpgmailcom/" target="_blank">article</a> from my ubuntu-tutorials.com RSS feed on SMTP relaying with Postfix through GMail.</p>
 <img src="http://www.anthonyldechiaro.com/blog/wp-content/plugins/feed-statistics.php?view=1&post_id=71" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.anthonyldechiaro.com/blog/archives/71/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple rsync raid-like mirror script</title>
		<link>http://www.anthonyldechiaro.com/blog/archives/11</link>
		<comments>http://www.anthonyldechiaro.com/blog/archives/11#comments</comments>
		<pubDate>Sat, 04 Oct 2008 04:07:49 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[admin]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://www.anthonyldechiaro.com/blog/?p=11</guid>
		<description><![CDATA[When I originally build my NFS/NAS server I decided to go for a software-based RAID 1 array for the OS install itself.  The storage drive was RAID-5 based but that is a different story.  I can&#8217;t recall the specifics exactly but I do remember a few times having difficulty booting off of the second drive [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">When I originally build my NFS/NAS server I decided to go for a software-based RAID 1 array for the OS install itself.  The storage drive was RAID-5 based but that is a different story.  I can&#8217;t recall the specifics exactly but I do remember a few times having difficulty booting off of the second drive and during the rebuild thought a slightly different design would be worth a try.  Since I had two identical drives from the array I figured the mirroring was a good idea, it was just the mdadm driver that I wanted to avoid.  Instead a manual mirror with rsync was in order.</p>
<p style="text-align: justify;">I did base my design upon some very good backup <a href="http://www.halfgaar.net/backing-up-unix" target="_blank">reference</a> information.  Plus with this way it would be easy to boot from if ever needed and take tar archives of the data without dealing with file consistency or modification issues.</p>
<p style="text-align: justify;">Here&#8217;s how it works:</p>
<p style="text-align: justify;"><span id="more-11"></span></p>
<p style="text-align: justify;">Duplicate the partition table for your source/OS drive (or whichever drive you want to use) .  I did this manually with fdisk, but you could easily do it with:</p>
<pre style="text-align: justify;">dd if=/dev/&lt;src&gt; of=/dev/&lt;dest&gt; bs=512 count=1</pre>
<p style="text-align: justify;">Obviously replacing &lt;src&gt; and &lt;dest&gt; with the source and destination disks &#8211; it is <em><strong>critical</strong></em> you have them in the right order.  However this won&#8217;t work with extended partitions as they have additional tables.  You can read more <a href="http://swik.net/IsiSetup/Huerlisi+blogging+on+IsiSetup/Duplicate+partition+table+for+RAID+1/4w4z" target="_blank">here</a> if you like.</p>
<p style="text-align: justify;">Configure fstab to use UUID&#8217;s if not already done.  Have the partitions on the mirror/destination disk mounted under a common mount point, eg: /backup.</p>
<pre># /dev/sda2
UUID=50128bb8-7aa4-4b45-b2c6-5e406c641004 /               ext3
# /dev/sda1
UUID=f0cd2333-868c-4a31-8386-554070cdfc5e /boot           ext3
# /dev/sda3
UUID=62f0da84-24af-485b-8cab-81c90e740156 /home           ext3
UUID=adbd21df-2d93-4868-8272-74c4fd98ca71 /backup         ext3
UUID=32be4980-0bac-463c-bf54-2d2eb59e3942 /backup/boot    ext3
UUID=936c69b7-f076-4140-9e80-142858907862 /backup/home    ext3</pre>
<p>I also have the /backup partitions mounted read-only and only change when actually doing the backup.</p>
<p>Configure the correct settings in the script.  We want to specify the source partitions to backup.</p>
<pre>UUIDS=( 50128bb8-7aa4-4b45-b2c6-5e406c641004 f0cd2333-868c-4a31-8386-554070cdfc5e 62f0da84-24af-485b-8cab-81c90e740156 )

BKUP_MNT=/backup</pre>
<p>You can <a href="/files/server_sync_root.sh">download</a> the script or <a href="http://wiki.anthonyldechiaro.com/tiki-index.php?page=server_sync_root">view</a> it in my wiki.  Feel free to leave comments and suggestions.  I did some basic debugging and seems to work just fine for me, but I am not held responsible for any consequences. <img src='http://www.anthonyldechiaro.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h6><strong>Update: See latest script version <a href="/blog/archives/182">here</a></strong></h6>
 <img src="http://www.anthonyldechiaro.com/blog/wp-content/plugins/feed-statistics.php?view=1&post_id=11" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.anthonyldechiaro.com/blog/archives/11/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
