How to setup FTP on Linode?

To install the VSFTP server on Ubuntu

sudo apt-get install vsftpd

Once you've got it installed you'll need to tweek the configuration, edit /etc/vsftpd.conf

Disable anonymous logins find the anonymous_enable directive and make it

anonymous_enable=NO

Enable local accounts to login set the local_enable directive to

local_enable=YES

Allow writes by setting the write_enable directive

write_enable=YES

Restart the ftp server so your changes take effect.

sudo service vsftpd restart


In order to enable the use of SSH2 for your updates and theme uploads, you have to generate your SSH keys and have the PHP SSH module installed. Then WordPress will detect that you have SSH2 available and you'll see a different option (SSH2) displayed when doing an upload/upgrade.

1.) Make sure you have the PHP module installed for debian it is:

sudo apt-get install libssh2-php

2.) Generate SSH keys, adding a passphrase is optional:

ssh-keygen
cd  ~/.ssh
cp id_rsa.pub authorized_keys

3.) Change the permission so that WordPress can access those keys:

cd ~
chmod 755 .ssh
chmod 644 .ssh/*

Now you'll get the SSH2 option when doing an upload/upgrade/plugin. Here is a pic, I don't have enough rep. to post an image. Here is a link to the image that you'll get, hopefully this is okay to include. https://www.dropbox.com/s/1m7fxlkp0nchplx/ssh-connection.png

4.) For added ease you can setup the defaults in your wp-config.php and this will pre-populate the SSH credentials in the WordPress upload window.

define('FTP_PUBKEY','/home/<user>/.ssh/id_rsa.pub');
define('FTP_PRIKEY','/home/<user>/.ssh/id_rsa');
define('FTP_USER','<user>');
define('FTP_PASS','passphrase');
define('FTP_HOST','domain.com');

The 'passphrase' is optional, if you don't setup a passphrase during ssh-kengen; then don't add it in wp-config.php

This solved my issue. And I didn't have to do the chown at all. But I have seen this method referenced in other places.

References:

  • http://wp.tutsplus.com/articles/tips-articles/quick-tip-upgrade-your-wordpress-site-via-ssh/
  • Search codex.wordpress.org for Editing_wp-config.php#Enabling_SSH_Upgrade_Access (I don't have enough rep to include more than 2 links, sorry)

Actually, you do not need a ftp server running on your server to solve this problem.

If you are running nginx, just simply go to /path/to/yout/wordpress/ and type this command in your SSH connection window:

chown -R www .

I'm not sure how to change user permission if you are running apache, change www to the apache group name like httpd may will work:

chown -R httpd .