<?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>le blog &#187; Linux</title>
	<atom:link href="http://www.normyee.net/blog/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.normyee.net/blog</link>
	<description></description>
	<lastBuildDate>Fri, 03 Feb 2012 20:51:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Adding Cloudflare support to fail2ban</title>
		<link>http://www.normyee.net/blog/2012/02/02/adding-cloudflare-support-to-fail2ban/</link>
		<comments>http://www.normyee.net/blog/2012/02/02/adding-cloudflare-support-to-fail2ban/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 23:05:28 +0000</pubDate>
		<dc:creator>norm</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[cloudflare]]></category>

		<guid isPermaLink="false">http://www.normyee.net/blog/?p=332</guid>
		<description><![CDATA[I use a few open source packages to help automate some defensive responses against hackers to my server. One is fail2ban. fail2ban can be configured to monitor pretty much any system daemon that produces a log file. I also use CloudFlare, which is a CDN and DNS service that amongst its many features is automatic [...]]]></description>
			<content:encoded><![CDATA[<p>I use a few open source packages to help automate some defensive responses against hackers to my server. One is <a href="http://www.fail2ban.org/" target="_blank">fail2ban</a>. fail2ban can be configured to monitor pretty much any system daemon that produces a log file.</p>
<p>I also use <a href="https://www.cloudflare.com/" target="_blank">CloudFlare</a>, which is a CDN and DNS service that amongst its <a href="https://www.cloudflare.com/overview" target="_blank">many features</a> is automatic protection against malicious attacks (DDoS, SQL injections, comment spamming, etc). In addition, if there are IPs that slip through their detection, you can add them manually to your CloudFlare blacklist. Automatically detecting these additional IPs, and adding them to CloudFlare, is where fail2ban comes in.</p>
<p>So on to my scenario: I noticed some very specific, recurring HTTP requests on my server that served no purpose other than to probe for a vulnerability or to attack my server, a perfect scenario for creating a fail2ban &#8220;<a href="http://www.fail2ban.org/wiki/index.php/MANUAL_0_8#Jails" target="_blank">jail</a>.&#8221; A fail2ban jail is a combination of a fail2ban <a href="http://www.fail2ban.org/wiki/index.php/MANUAL_0_8#Filters" target="_blank">filter</a> and <a href="http://www.fail2ban.org/wiki/index.php/MANUAL_0_8#Actions" target="_blank">action</a>. Typically you have a jail configured to block an IP at the iptables level, but I wanted it to be blocked at the CloudFlare level as well.</p>
<p>Setting up a fail2ban jail is pretty straightforward. The jail contains all the information that fail2ban needs to detect and act upon a matched condition. In a typical fail2ban install, you&#8217;ll find the jail.conf file, where all the jails are defined, at <code>/etc/fail2ban/jail.conf</code> </p>
<p><strong>Creating a new fail2ban jail</strong></p>
<p>Creating a new jail is as simple as adding something like so to jail.conf:</p>
<pre class="brush: bash; auto-links: false; title: ; notranslate">
[some-jail-name]
enabled  = true
filter   = my-filter-name
action   = iptables-allports[name=some-jail-name, protocol=tcp]
           cloudflare-blacklist
           sendmail-whois[name=some-jail-name, dest=me@example.com]
logpath  = /var/log/some/log
maxretry = 0
bantime  = 604800
</pre>
<p>This creates a fail2ban filter called &#8220;some-jail-name&#8221;, scanning the log &#8220;/var/log/some/log&#8221; defined by &#8220;logpath,&#8221; applying the filter &#8220;my-filter-name&#8221; defined by &#8220;filter&#8221; on said log, and acting upon a match with the action(s) defined by &#8220;action&#8221; by doing the following: 1) block the IP in iptables, 2) block the IP at CloudFlare, and 3) send me a notification email. (Consult the fail2ban manual on <a href="http://www.fail2ban.org/wiki/index.php/MANUAL_0_8#Jail_Options" target="_blank">jail options</a> to see what they all mean)</p>
<p><strong>Creating the fail2ban filter</strong></p>
<p>The filter &#8220;my-filter-name&#8221; would then be defined at <code>/etc/fail2ban/filter.d/my-filter-name.conf</code>. Make sure to modify the failregex regex string to match what you are looking for in the log file. Be sure to consult the section on <a href="http://www.fail2ban.org/wiki/index.php/MANUAL_0_8#Testing" target="_blank">testing your filters</a> in the fail2ban manual to confirm your filter works correctly.</p>
<pre class="brush: bash; auto-links: false; title: ; notranslate">
[Definition]

# Option:  failregex
# Notes.:  regex to match the suspicious attemps in the logfile. The
#          host must be matched by a group named &amp;quot;host&amp;quot;. The tag &amp;quot;&amp;lt;HOST&amp;gt;&amp;quot; can
#          be used for standard IP/hostname matching and is only an alias for
#          (?:::f{4,6}:)?(?P&amp;lt;host&amp;gt;\S+)
# Values:  TEXT
#
failregex = ^&amp;lt;HOST&amp;gt; -.*POST /tmp.*$ 

# Option:  ignoreregex
# Notes.:  regex to ignore. If this regex matches, the line is ignored.
# Values:  TEXT
#
ignoreregex =
</pre>
<p><strong>Creating the fail2ban action</strong></p>
<p>And finally, the action &#8220;cloudflare-blacklist&#8221; is defined at <code>/etc/fail2ban/action.d/cloudflare-blacklist.conf</code>. It will call CloudFlare&#8217;s <a href="http://www.cloudflare.com/wiki/Client_Interface_API" target="_blank">client API</a> to add/remove an IP from your blacklist. </p>
<p>In order to configure your action properly: </p>
<ol>
<li>Go to your CloudFlare <a href="https://www.cloudflare.com/my-account" target="_blank">account settings page</a> to get your API key (it should be near the bottom of the page)
</li>
<li>In the actionban and actionunban sections, replace CLOUDFLARE_API_TOKEN with your API key</li>
<li>In the actionban and actionunban sections,replace CLOUDFLARE_LOGIN with your CloudFlare login email</li>
</ol>
<pre class="brush: bash; auto-links: false; title: ; notranslate">
# Fail2Ban configuration file
#
# Author: Norman Yee
#
# $Revision$
#

[Definition]

# Option:  actionstart
# Notes.:  command executed once at the start of Fail2Ban.
# Values:  CMD
#
actionstart =

# Option:  actionstop
# Notes.:  command executed once at the end of Fail2Ban
# Values:  CMD
#
actionstop =

# Option:  actioncheck
# Notes.:  command executed once before each actionban command
# Values:  CMD
#
actioncheck =

# Option:  actionban
# Notes.:  command executed when banning an IP. Take care that the
#          command is executed with Fail2Ban user rights.
# Tags:    &amp;lt;ip&amp;gt;  IP address
#          &amp;lt;failures&amp;gt;  number of failures
#          &amp;lt;time&amp;gt;  unix timestamp of the ban time
# Values:  CMD
#
actionban = curl -s &amp;quot;https://www.cloudflare.com/api.html?a=ban&amp;amp;key=&amp;lt;ip&amp;gt;&amp;amp;u=CLOUDFLARE_LOGIN&amp;amp;tkn=CLOUDFLARE_API_TOKEN&amp;quot;

# Option:  actionunban
# Notes.:  command executed when unbanning an IP. Take care that the
#          command is executed with Fail2Ban user rights.
# Tags:    &amp;lt;ip&amp;gt;  IP address
#          &amp;lt;failures&amp;gt;  number of failures
#          &amp;lt;time&amp;gt;  unix timestamp of the ban time
# Values:  CMD
#
actionunban = curl -s &amp;quot;https://www.cloudflare.com/api.html?a=nul&amp;amp;key=&amp;lt;ip&amp;gt;&amp;amp;u=CLOUDFLARE_LOGIN&amp;amp;tkn=CLOUDFLARE_API_TOKEN&amp;quot;
</pre>
<p>Once you have the jail, filter, and action set up and configured in fail2ban, you should be all set, with an additional layer of security courtesy of CloudFlare!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.normyee.net/blog/2012/02/02/adding-cloudflare-support-to-fail2ban/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CloudFlare, Apache, WordPress and IP address logging</title>
		<link>http://www.normyee.net/blog/2011/10/06/cloudflare-apache-wordpress-and-ip-address-logging/</link>
		<comments>http://www.normyee.net/blog/2011/10/06/cloudflare-apache-wordpress-and-ip-address-logging/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 06:53:40 +0000</pubDate>
		<dc:creator>norm</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[webdev]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[cloudflare]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.normyee.net/blog/?p=299</guid>
		<description><![CDATA[If like me, you use the very useful CloudFlare service to speed up &#38; protect your site(s), you may have noticed that since using CloudFlare, your access logs may seem to have a ton of visits from a very narrow range of IP addresses. This is because CloudFlare acts as a reverse proxy and the IPs [...]]]></description>
			<content:encoded><![CDATA[<p>If like me, you use the very useful <a href="http://cloudflare.com" target="_blank">CloudFlare</a> service to speed up &amp; protect your site(s), you may have noticed that since using CloudFlare, your access logs may seem to have a ton of visits from a very narrow range of IP addresses. This is because CloudFlare acts as a <a href="http://en.wikipedia.org/wiki/Reverse_proxy" target="_blank">reverse proxy</a> and the IPs you are seeing are from CloudFlare&#8217;s network.</p>
<p>This is a bit sucky for analytics since those IPs are not of the actual visitors to your site(s). The original IP is still in the HTTP request headers when CloudFlare is enabled, though, and looks something like this sample request header:</p>
<pre class="brush: bash; highlight: [4]; title: ; notranslate">
GET /blog/feed/ HTTP/1.0
Host: www.normyee.net
Accept-Encoding: gzip
CF-Connecting-IP: 66.249.71.111
CF-IPCountry: US
X-Forwarded-For: 66.249.71.111
Connection: close
Set-Keepalive: 0
Accept: */*
From: googlebot(at)googlebot.com
User-Agent: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
</pre>
<p>CloudFlare inserts a <code>CF-Connecting-IP</code> header containing the original requester&#8217;s IP. In this case, the IP 66.249.71.111 is google&#8217;s web crawler paying me a visit, although the request was logged as coming from 199.27.128.71 &#8212; one of CloudFlare&#8217;s IPs. We of course want the original IP logged, and not CloudFlare&#8217;s. Fortunately there are quick solutions for both Apache and WordPress.</p>
<p>For Apache, CloudFlare has an Apache module, mod_cloudflare, which you&#8217;ll need to compile from source for your system. You can get more info and instructions <a href="http://www.cloudflare.com/wiki/Log_Files" target="_blank">here</a> &amp; view <a href="https://github.com/cloudflare/CloudFlare-Tools/blob/master/mod_cloudflare.c" target="_blank">the source on github here</a> (it&#8217;s linked to from the previous link as well). It&#8217;s pretty straightforward, assuming you have shell access and the ability to run apxs (the <a href="http://httpd.apache.org/docs/2.2/programs/apxs.html" target="_blank">APache eXtenSion tool</a>).</p>
<p>For WordPress, you can just simply download the <a href="http://wordpress.org/extend/plugins/cloudflare/" target="_blank">CloudFlare WordPress plugin at wordpress.org</a> to get the correct IPs back in WordPress. CloudFlare has a <a href="http://www.cloudflare.com/wiki/CloudFlareWordPressPlugin" target="_blank">wiki page for the plugin</a> as well, but the WordPress.org plugin page has all the info you need.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.normyee.net/blog/2011/10/06/cloudflare-apache-wordpress-and-ip-address-logging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More robust Postfix anti-spam configuration</title>
		<link>http://www.normyee.net/blog/2011/08/05/more-robust-postfix-anti-spam-configuration/</link>
		<comments>http://www.normyee.net/blog/2011/08/05/more-robust-postfix-anti-spam-configuration/#comments</comments>
		<pubDate>Fri, 05 Aug 2011 17:34:25 +0000</pubDate>
		<dc:creator>norm</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[dnswl]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://www.normyee.net/blog/?p=231</guid>
		<description><![CDATA[My last post included an updated Postfix main.cf that was better at blocking spam and minimizing false positives through the use of DNS white lists (DNSWLs), but after a few days it was still letting in more spam than I wanted. I did additional tweaking and the following seems to work better, while still preventing false positives. [...]]]></description>
			<content:encoded><![CDATA[<p>My last post included an updated Postfix main.cf that was better at blocking spam and minimizing false positives through the use of DNS white lists (DNSWLs), but after a few days it was still letting in more spam than I wanted. I did additional tweaking and the following seems to work better, while still preventing false positives.</p>
<p>The main changes included specifying the following additional Postfix restrictions:</p>
<ul>
<li>smtpd_sender_restrictions</li>
<li>smtpd_helo_restrictions</li>
<li>smtpd_data_restrictions</li>
</ul>
<pre class="brush: bash; title: ; notranslate">
smtpd_helo_restrictions =
	reject_unknown_helo_hostname

smtpd_data_restrictions =
	reject_unauth_pipelining

smtpd_client_restrictions =
	permit_dnswl_client list.dnswl.org,
	reject_rbl_client b.barracudacentral.org,
	reject_rbl_client hostkarma.junkemailfilter.com=127.0.0.2,

smtpd_sender_restrictions =
	reject_unknown_sender_domain,
	reject_unknown_address,
	reject_rhsbl_sender dsn.rfc-ignorant.org,
	reject_rhsbl_reverse_client dbl.spamhaus.org,
	reject_rbl_client b.barracudacentral.org,

smtpd_recipient_restrictions =
	permit_mynetworks,
	reject_invalid_hostname,
	reject_non_fqdn_sender,
	reject_non_fqdn_recipient,
	reject_unknown_sender_domain,
	reject_unknown_recipient_domain,
	reject_unauth_destination,
	permit_dnswl_client list.dnswl.org,

	reject_rhsbl_reverse_client dbl.spamhaus.org,
	reject_rhsbl_sender dbl.spamhaus.org,
	reject_rhsbl_client dbl.spamhaus.org,
	reject_rhsbl_sender fresh15.spameatingmonkey.net,
	reject_rhsbl_client fresh15.spameatingmonkey.net,
	reject_rhsbl_sender uribl.spameatingmonkey.net,
	reject_rhsbl_client uribl.spameatingmonkey.net,
	reject_rhsbl_sender urired.spameatingmonkey.net,
	reject_rhsbl_client urired.spameatingmonkey.net,
	reject_rhsbl_client hostkarma.junkemailfilter.com=127.0.0.2,

	reject_rbl_client b.barracudacentral.org,
	reject_rbl_client zen.spamhaus.org,
	reject_rbl_client bl.spameatingmonkey.net,
	reject_rbl_client bl.spamcop.net,
	reject_rbl_client hostkarma.junkemailfilter.com=127.0.0.2,
	reject_rbl_client dnsbl.njabl.org,
	reject_rbl_client bl.tiopan.com,
	reject_rbl_client spamsources.fabel.dk,
	reject_rbl_client truncate.gbudb.net,
	reject_rbl_client ubl.unsubscore.com,
	reject_rbl_client aspews.ext.sorbs.net,
	reject_rbl_client dnsbl.sorbs.net,
	reject_rbl_client backscatter.spameatingmonkey.net,
	reject_rbl_client bl.spameatingmonkey.net,

	permit
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.normyee.net/blog/2011/08/05/more-robust-postfix-anti-spam-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using DNS whitelists in Postfix</title>
		<link>http://www.normyee.net/blog/2011/07/08/using-dns-whitelists-in-postfix/</link>
		<comments>http://www.normyee.net/blog/2011/07/08/using-dns-whitelists-in-postfix/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 20:15:22 +0000</pubDate>
		<dc:creator>norm</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[dnswl]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://www.normyee.net/blog/?p=206</guid>
		<description><![CDATA[Update 7/21/2011: I&#8217;ve tweaked my main.cf config more recently that provided better results. I will have a follow-up post with the changes and additions. In an earlier post several years back, I wrote about using DNS blacklists (DNSBLs) in postfix to block unwanted spam from hitting my inbox, and in the last week I tweaked it [...]]]></description>
			<content:encoded><![CDATA[<p><em>Update 7/21/2011: I&#8217;ve tweaked my main.cf config more recently that provided better results. I will have a follow-up post with the changes and additions.</em></p>
<p>In an <a title="Stemming spam" href="http://www.normyee.net/blog/2007/09/29/stemming-spam/" target="_blank">earlier post</a> several years back, I wrote about using DNS blacklists (DNSBLs) in postfix to block unwanted spam from hitting my inbox, and in the last week I tweaked it a bit to include <a href="http://en.wikipedia.org/wiki/DNSWL" target="_blank">DNS whitelists</a> (DNSWLs). I was discovering that some of the DNSBLs were blocking a small portion of legitimate email from coming through (eg. blocking entire IP ranges for webmail providers).</p>
<p>You need Postfix 2.8 or higher (I was on 2.3.3 so I had to download and compile the latest, 2.8.3), which has a new configuration parameter which added support for querying a DNSWL like a DNSBL:</p>
<pre>permit_dnswl_client dnswl_domain=d.d.d.d</pre>
<p>The relevant portion of my updated Postfix main.cf is below (note permit_dnswl_client is inserted <em><strong>before</strong></em> any of the reject_rbl* parameters). The DNSWL queries are processed first before the DNSBLs, so it should allow legitimate IPs through and reduce the amount of false positives vs just using the DNSBLs alone.</p>
<pre class="brush: bash; title: ; notranslate">smtpd_recipient_restrictions =
        permit_mynetworks,
        reject_invalid_hostname,
        reject_non_fqdn_sender,
        reject_non_fqdn_recipient,
        reject_unknown_sender_domain,
        reject_unknown_recipient_domain,
        reject_unauth_destination,
        permit_dnswl_client list.dnswl.org,
        reject_rbl_client b.barracudacentral.org,
        reject_rbl_client zen.spamhaus.org,
        reject_rbl_client bl.spameatingmonkey.net,
        reject_rbl_client bl.spamcop.net,
        reject_rbl_client hostkarma.junkemailfilter.com=127.0.0.2,
        reject_rbl_client dnsbl.njabl.org,
        reject_rbl_client bl.tiopan.com,
        reject_rbl_client spamsources.fabel.dk,
        reject_rbl_client truncate.gbudb.net,
        reject_rbl_client ubl.unsubscore.com,
        reject_rbl_client aspews.ext.sorbs.net,
        reject_rbl_client dnsbl.sorbs.net,
        reject_rbl_client backscatter.spameatingmonkey.net,
        reject_rbl_client bl.spameatingmonkey.net,
        reject_rhsbl_sender fresh15.spameatingmonkey.net,
        reject_rhsbl_client fresh15.spameatingmonkey.net,
        reject_rhsbl_sender uribl.spameatingmonkey.net,
        reject_rhsbl_client uribl.spameatingmonkey.net,
        reject_rhsbl_sender urired.spameatingmonkey.net,
        reject_rhsbl_client urired.spameatingmonkey.net,
        reject_rbl_client dnsbl.inps.de,
        reject_rbl_client DDNSBL.InternetDefenseSystems.com,
        permit</pre>
<p>After watching the logs for the last couple days, this setup seems to work quite well&#8230;only 1 piece of spam slipped through, and more importantly, no false positives! I should also note that I stopped using spamassassin a while back and just these settings in postfix seems to block almost all legitimate spam coming into my server while not generating false positives.</p>
<p>BTW, if you want to tail your maillog from the command line in realtime and see the rejects in a more readable format, this short one liner will work:</p>
<pre>$ tail -f /var/log/maillog | sed -r -n 's/^.* blocked using ([^;]+).*; from=]+)&gt;\s*to=]+)&gt;.*$/\1 - \2 - \3/p'</pre>
<p>it will output in the format <strong>DNSBL &#8211; FROM ADDRESS &#8211; TO ADDRESS</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.normyee.net/blog/2011/07/08/using-dns-whitelists-in-postfix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updating WordPress via SSH instead of FTP</title>
		<link>http://www.normyee.net/blog/2009/12/01/updating-wordpress-via-ssh-instead-of-ftp/</link>
		<comments>http://www.normyee.net/blog/2009/12/01/updating-wordpress-via-ssh-instead-of-ftp/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 19:09:54 +0000</pubDate>
		<dc:creator>norm</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.normyee.net/blog/?p=120</guid>
		<description><![CDATA[I&#8217;ve shut off FTP access to my server a while back, since FTP passwords are passed in plaintext over the net which is A Bad Thing™. For the occasions that I would need to update WordPress via its web interface, I would start up the FTP daemon so that I could use WordPress&#8217; auto-update feature, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve shut off FTP access to my server a while back, since FTP passwords are <a href="http://en.wikipedia.org/wiki/Ftp#Security_problems" target="_blank">passed in plaintext over the net</a> which is A Bad Thing™. For the occasions that I would need to update WordPress via its web interface, I would start up the FTP <a href="http://en.wikipedia.org/wiki/Daemon_%28computer_software%29" target="_blank">daemon</a> so that I could use WordPress&#8217; auto-update feature, and then shut it back down after I was done. Not that big of a hassle, but it required me to login into my server before doing anything from the web interface which was one step too many.</p>
<p>I discovered that WordPress has built-in support for <a href="http://codex.wordpress.org/Editing_wp-config.php#FTP.2FSSH_Constants" target="_blank">updating via SSH2</a> if PHP has the <a href="http://en.wikipedia.org/wiki/PHP_Extension_Community_Library#PECL" target="_blank">PECL</a> <a href="http://pecl.php.net/package/ssh2" target="_blank">SSH2 library</a> installed. Following is a quick summary of how to get it running.</p>
<p>The PECL ssh2 library requires <a href="http://www.sourceforge.net/projects/libssh2" target="_blank">libssh2</a> which I downloaded and then compiled painlessly with a</p>
<pre class="brush: bash; gutter: true; title: ; toolbar: false; notranslate">$ ./configure
$ make
$ make install</pre>
<p>Once libssh2 was compiled and installed, I installed the PECL ssh2 library via</p>
<pre class="brush: bash; gutter: true; title: ; toolbar: false; notranslate">$ pecl install -f ssh2</pre>
<p>The -f flag is to force the install since ssh2 is still in beta &amp; you&#8217;d otherwise get a warning like</p>
<pre class="brush: plain; auto-links: false; light: true; title: ; notranslate">Failed to download pecl/ssh2 within preferred state &quot;stable&quot;, latest release is version 0.11.0, stability &quot;beta&quot;, use &quot;channel://pecl.php.net/ssh2-0.11.0&quot; to install</pre>
<p>After installing ssh2 via pecl, i edited the php.ini file (located at /etc/php.ini for me) to tell PHP to load this extension</p>
<pre class="brush: bash; gutter: true; title: ; toolbar: false; notranslate">extension=ssh2.so</pre>
<p>and then restart apache afterwards (via <code>apachctl</code>, <code>service httpd restart</code>, or whatever is appropriate for your system) so that the library would be available to PHP.</p>
<p>After apache comes back up, you should see a new option (SSH) in the wordpress upgrade page (which applies to plugins as well).</p>
<p>BTW, if you&#8217;re on a Red Hat Fedora system and/or use <a href="http://en.wikipedia.org/wiki/Yellowdog_Updater,_Modified" target="_blank">yum</a>, you might be able to just pull the libssh2 rpm from yum instead of compiling it:</p>
<pre class="brush: bash; gutter: true; title: ; toolbar: false; notranslate">$ yum install libssh2
$ yum install libssh2-devel
$ yum install libssh2-docs</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.normyee.net/blog/2009/12/01/updating-wordpress-via-ssh-instead-of-ftp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using apc
Object Caching 728/779 objects using apc

Served from: www.normyee.net @ 2012-02-05 10:29:34 -->
