Enable SFTP update WordPress Mac OS X 10.7

First posted on the 23rd November, 2011 – IT
Last modified on the 2nd November, 2013, at 2:03 pm

Although worpress allow an auto update feature, by default it only allows either FTP or FTPS. Ideally I would like to use SFTP as this would only require the SSH port to be open on my web-server.

Update: Currently I use this plugin: SSH SFTP Updater Support

To enable this the following steps need to be done:
download, compile and install libssh2
cd libssh2
./configure
make
sudo make install

install the perl SSH2 component

sudo pecl install -f ssh2

enable the ssh2 componant by adding the following line to /etc/php.ini
extension=ssh2.so

using the following command:
sudo nano /etc/php.ini

restart php by either disabling and re-enabling php application in Server.app or restarting whole webserver.

After this a third radio button should appear when you have to imput the server information for SSH2, along with FTP and FTPS. Now add paths to public and private key.

~/.ssh/id_rsa.pub
~/.ssh/id_rsa

Update: Don’t really see a security upgrade if you have to make your private key readable by webserver! Probably better off using FTP on an obscure port!