WordPress: Enabling SSH/SFTP Updates
The first time I dealt with WordPress was when I first started doing IT administration for FanHistory. At that point in time I knew nothing about it and it was breaking horribly. Luckily I managed to fix the issues (which turned out to be Varnish proxy related) and get it standing mostly on its own two feet. One of “minor annoyances” I ran into then and absolutely had to figure out during my migration, was the lack of SSH or SFTP based updates. By default when you go into add or update the plugins (or the software itself) you have only two options FTP and FTPS (SSL). I run neither of these, FTP is majorly old and very insecure. FTPS is just not common. I thought I was stuck doing things manually, until I found out…. You can enable SSH2 based updates in WordPress. Better yet, it is SUPER easy.
Get yourself to a command line, and assuming your running Ubuntu or Debian:
- apt-get install libssh2-php
- /etc/init.d/apache2 restart
It is literally that easy, all you need to do is install libssh2-php which is the PHP bindings for libssh2. If your running another flavor of Linux, just search your package manager for “libssh2” and pipe it to “grep php”. You’ll most likely find the package your looking for. You may also need to manually enable the module; Ubuntu does that for me. After you restart Apache with that new module, simply go into your WordPress administration interface and you’ll see the “SSH2” option in any Install/Update screen.
Note: It does support SSH keys, along with the standard password authentication. I’ve not tried a key with a password on it, so if you try it, let me know how it works.