<?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>Fireside Media Development Blog &#187; security</title>
	<atom:link href="http://www.firesidemedia.net/dev/tag/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.firesidemedia.net/dev</link>
	<description></description>
	<lastBuildDate>Mon, 24 Aug 2009 23:23:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>WordPress Tutorial: Using SSH to Install/Upgrade</title>
		<link>http://www.firesidemedia.net/dev/wordpress-install-upgrade-ssh/</link>
		<comments>http://www.firesidemedia.net/dev/wordpress-install-upgrade-ssh/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 20:33:13 +0000</pubDate>
		<dc:creator>Jonathan Dingman</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.firesidemedia.net/dev/?p=81</guid>
		<description><![CDATA[This tutorial will guide you step by step on how to setup your server so you can install new plugins and upgrade existing plugins using an SSH2 layer in PHP and WordPress. What is WordPress? WordPress started in 2003 with a single bit of code to enhance the typography of everyday writing and with fewer [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial will guide you <strong>step by step</strong> on how to setup your server so you can <strong>install new plugins and upgrade existing plugins using an SSH2</strong> layer in PHP and WordPress.</p>
<p><strong>What is WordPress?</strong><br />
WordPress started in 2003 with a single bit of code to enhance the typography of everyday writing and with fewer users than you can count on your fingers and toes. Since then it has grown to be the largest self-hosted blogging tool in the world, used on hundreds of thousands of sites and seen by tens of millions of people every day.</p>
<p><strong>What is SSH[2]?</strong><br />
SSH (Secure Shell) is a protocol allowing a secure channel to be established between a web server and a client&#8217;s local machine. Many web hosting companies now offer SSH for greater security.<br />
<span id="more-81"></span></p>
<hr />
<p><strong>Tutorial Pre-requisites</strong></p>
<p>There are a few things that need to be in place before you can actually use this tutorial.</p>
<p>The first thing to do is make sure you have SSH2 installed via pecl.  If it&#8217;s not installed or you&#8217;re not sure, run this command: <strong>pecl install ssh2</strong></p>
<p><strong>note:</strong>  If your case is where the installed version of SSh2 is beta, run this command instead: <strong>pecl install channel://pecl.php.net/ssh2-0.11.0</strong></p>
<p>If you don&#8217;t feel comfortable running these commands yourself and you know of a server administrator that can help, or you&#8217;re paying for managed services, ask them to install this for you.</p>
<p>After SSH2 is installed, follow these instructions to ensure that the SSH2 extension is enabled in PHP.  Again, if you are using managed services, simply ask them to do this for you.</p>
<dl>
<dt>Ubuntu/Debian</dt>
<dd>cd /etc/php5/conf.d; echo &#8220;extension=ssh2.so&#8221; > ssh2.ini</dd>
<dd>/etc/init.d/apache2 restart</dd>
<dt>Red Hat, CentOS, Fedora</dt>
<dd>cd /etc/php.d; echo &#8220;extension=ssh2.so&#8221; > ssh2.ini</dd>
<dd>/etc/init.d/httpd restart</dd>
</dl>
<hr />
<h3>Step 1: Generating the server-side RSA keys</h3>
<pre class="brush: plain;">
ssh-keygen
</pre>
<p><em>Generating public/private rsa key pair.<br />
Enter file in which to save the key (/home/user1/.ssh/id_rsa):<br />
Created directory &#8216;/home/user1/.ssh&#8217;.<br />
Enter passphrase (empty for no passphrase): <strong>(just hit enter, no need for a password)</strong><br />
Enter same passphrase again: <strong>(same thing, hit enter again)</strong><br />
Your identification has been saved in /home/user1/.ssh/id_rsa.<br />
Your public key has been saved in /home/user1/.ssh/id_rsa.pub.<br />
The key fingerprint is:<br />
xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx user1@server1.example.com</em></p>
<p><small>The xx:xx:xx etc. will be replaced with your actual fingerprint.</small></p>
<h3>Step 2: Creating an &#8216;authorized_keys&#8217; file</h3>
<pre class="brush: plain;">
cd .ssh
cp id_rsa.pub authorized_keys
</pre>
<h3>Step 3: Setting the proper file permissions</h3>
<pre class="brush: plain;">
cd ~/
chmod 755 .ssh
chmod 644 .ssh/*
</pre>
<h3>Step 4: Choosing the &#8216;SSH&#8217; option</h3>
<p><img src="http://www.firesidemedia.net/dev/files/wordpress-ssh-connection-information.jpg" alt="WordPress SSH Connection Information" title="WordPress SSH Connection Information" /></p>
<p>In this tutorial, I opted not to use a password, so you do not need to enter a password.</p>
<h3>Step 5: Click &#8220;Proceed&#8221;</h3>
<p>The last step is to click the proceed button and it will install a new plugin or upgrade an existing plugin via the integrated SSH layer in WordPress.  You should see results something like this&#8230;</p>
<p><img src="http://www.firesidemedia.net/dev/files/activated-plugin-via-ssh.jpg" alt="Activated WordPress Plugin via SSH" title="Activated WordPress Plugin via SSH" width="500" height="147" /></p>
<h3>== Optional ==</h3>
<p>If you want to automate the process a bit more, there are a few more things you can do to make it even easier.</p>
<p>If you open up your <strong>wp-config.php</strong> and add these lines, it will make the process smoother.</p>
<pre class="brush: plain;">
define('FTP_PUBKEY','/home/user1/.ssh/id_rsa.pub');
define('FTP_PRIKEY','/home/user1/.ssh/id_rsa');
define('FTP_USER','user1');
define('FTP_PASS','');
define('FTP_HOST','server1.example.com:22');
</pre>
<p>Now, when you click &#8220;upgrade&#8221; or &#8220;install&#8221; on a new plugin, it will bypass the first screen you saw above asking for the details.  It will automatically go into the process and start the install/upgrade.</p>
<h3>Thank you</h3>
<p>A huge thanks to <a href="http://dd32.id.au/">Dion Hulse</a> and <a href="http://sivel.net/">Matt Martz</a> for helping me with creating this tutorial.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.firesidemedia.net/dev/wordpress-install-upgrade-ssh/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
	</channel>
</rss>
