<?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>another kangbudhi blog &#187; Uncategorized</title>
	<atom:link href="https://kangbudhi.staff.ugm.ac.id/?cat=1&#038;feed=rss2" rel="self" type="application/rss+xml" />
	<link>https://kangbudhi.staff.ugm.ac.id</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Fri, 03 Oct 2014 03:43:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>Configure SSH2 Access for Updating WordPress</title>
		<link>https://kangbudhi.staff.ugm.ac.id/?p=28</link>
		<comments>https://kangbudhi.staff.ugm.ac.id/?p=28#comments</comments>
		<pubDate>Mon, 03 Sep 2012 16:28:52 +0000</pubDate>
		<dc:creator>kangbudhi</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kangbudhi.staff.ugm.ac.id/?p=28</guid>
		<description><![CDATA[WordPress is one of the most popular blogging platforms on the Internet. One of the first things I do when I setup a new WordPress installation is harden it. You can read about a number of my suggestions in the &#8230; <a href="https://kangbudhi.staff.ugm.ac.id/?p=28">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>WordPress is one of the most popular blogging platforms on the Internet. One of the first things I do when I setup a new WordPress installation is harden it. You can read about a number of my suggestions in the article <a href="http://robpickering.com/?p=205">Secure Your WordPress Installation</a>. However, one of the more complex activities I undertake is securing the upgrade facility so that it uses SSH for handling all of my site’s updates.<span id="more-28"></span></p>
<p>This is for Ubuntu 10.04 LTS:</p>
<p>Create a “wordpress” user that will be used to manage your site.</p>
<div>
<div id="highlighter_255966">
<div><a href="http://robpickering.com/2012/05/configure-ssh2-access-for-updating-wordpress-645#">?</a></div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>
<div><code>% </code><code>sudo</code> <code>adduser wordpress</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Add the following lines to your wp-config.php, I usually put mine right after the Language definition:</p>
<div>
<div id="highlighter_500303">
<div><a href="http://robpickering.com/2012/05/configure-ssh2-access-for-updating-wordpress-645#">?</a></div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>
<div><code>/**</code></div>
<div><code> </code><code>* Define Upgrade FTP Usernames and Passwords</code></div>
<div><code>*/</code></div>
<div><code>define(</code><code>'FTP_BASE'</code><code>, </code><code>'/usr/local/sites/mysite/wordpress/'</code><code>);</code></div>
<div><code>define(</code><code>'FTP_CONTENT_DIR'</code><code>, </code><code>'/usr/local/sites/mysite/wordpress/wp-content/'</code><code>)</code></div>
<div><code>;</code></div>
<div><code>define(</code><code>'FTP_PLUGIN_DIR '</code><code>, </code><code>'/usr/local/sites/mysite/wordpress/wp-content/plugins/'</code><code>);</code></div>
<div><code>define(</code><code>'FTP_PUBKEY'</code><code>, </code><code>'/home/wordpress/.ssh/id_rsa.pub'</code><code>);</code></div>
<div><code>define(</code><code>'FTP_PRIKEY'</code><code>, </code><code>'/home/wordpress/.ssh/id_rsa'</code><code>);</code></div>
<div><code>define(</code><code>'FTP_USER'</code><code>, </code><code>'wordpress'</code><code>);</code></div>
<div><code>define(</code><code>'FTP_PASS'</code><code>, </code><code>''</code><code>);</code></div>
<div><code>define(</code><code>'FTP_HOST'</code><code>, </code><code>'localhost'</code><code>);</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Edit each of the variables for your installation.</p>
<p>Create an SSH public/private key pair for your wordpress user:</p>
<div>
<div id="highlighter_867656">
<div><a href="http://robpickering.com/2012/05/configure-ssh2-access-for-updating-wordpress-645#">?</a></div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>
<div><code>% </code><code>sudo</code> <code>su</code> <code>- wordpress</code></div>
<div><code>% </code><code>ssh</code><code>-keygen</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>When prompted to enter a password, just hit return to create the private key without a password.</p>
<p>Add the public key to wordpress’ authorized_keys file:</p>
<div>
<div id="highlighter_263815">
<div><a href="http://robpickering.com/2012/05/configure-ssh2-access-for-updating-wordpress-645#">?</a></div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>
<div><code>% </code><code>cp</code> <code>.</code><code>ssh</code><code>/id_rsa</code><code>.pub .</code><code>ssh</code><code>/authorized_keys</code></div>
<div><code>% </code><code>exit</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Set permissions on the private key so Apache/WordPress can access it:</p>
<div>
<div id="highlighter_820327">
<div><a href="http://robpickering.com/2012/05/configure-ssh2-access-for-updating-wordpress-645#">?</a></div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>
<div><code>% </code><code>sudo</code> <code>chgrp</code> <code>www-data </code><code>/home/wordpress/</code><code>.</code><code>ssh</code></div>
<div><code>% </code><code>sudo</code> <code>chmod</code> <code>750 </code><code>/home/wordpress/</code><code>.</code><code>ssh</code></div>
<div><code>% </code><code>sudo</code> <code>chown</code> <code>www-data </code><code>/home/wordpress/</code><code>.</code><code>ssh</code><code>/id_rsa</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Install php SSH2 libraries:</p>
<div>
<div id="highlighter_510951">
<div><a href="http://robpickering.com/2012/05/configure-ssh2-access-for-updating-wordpress-645#">?</a></div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>
<div><code>sudo</code> <code>apt-get </code><code>install</code> <code>php5-dev</code></div>
<div><code>sudo</code> <code>apt-get </code><code>install</code> <code>libssh2-1-dev</code></div>
<div><code>sudo</code> <code>apt-get </code><code>install</code> <code>libssh2-php</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Test to ensure PHP sees the new SSH2 library:</p>
<div>
<div id="highlighter_632520">
<div><a href="http://robpickering.com/2012/05/configure-ssh2-access-for-updating-wordpress-645#">?</a></div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>
<div><code>% php -m | </code><code>grep</code> <code>ssh2</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>It should output “ssh2″</p>
<p>Restart Apache so it pulls in the new PHP libraries:</p>
<div>
<div id="highlighter_546781">
<div><a href="http://robpickering.com/2012/05/configure-ssh2-access-for-updating-wordpress-645#">?</a></div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>
<div><code>% sudo service apache2 restart</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Now access your Plugins page, and when you add, update, or delete a plugin you should see a screen like this:</p>
<p><a href="http://robpickering.com/wp-content/uploads/2012/05/SSH-Connection.png"><img title="SSH Connection" src="http://robpickering.com/wp-content/uploads/2012/05/SSH-Connection-300x194.png" alt="" width="300" height="194" /></a></p>
<p>WordPress SSH Connection Information</p>
<p>You should only see this screen the first time you use this configuration. Select “SSH2″ from the Radio Buttons and “Proceed”.</p>
<p>You will now be using SSH access to/from your server to handle all updates</p>
<p>sumber http://robpickering.com/2012/05/configure-ssh2-access-for-updating-wordpress-645</p>
]]></content:encoded>
			<wfw:commentRss>https://kangbudhi.staff.ugm.ac.id/?feed=rss2&#038;p=28</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
