Recently at my full-time job we began the process of migrating all out sites to WordPress and to RackSpace cloud servers away from dedicated servers.
These servers utilize SSH for FTP connections and out of the box, WordPress does not play well with SSH. Below are the steps to allow WordPress to connect to SFTP using the Ubuntu OS.
If you are lucky, the only thing you need to do from the command line is:
apt-get install libssh2-php sudo /etc/init.d/apache restart
If you reload the FTP configuration screen, you will now see an “SSH2″ option.
When I did this, I ran into an error about not being able to find the “wp-content” folder. Using the snippet below fixed the problem. This snippet of code goes in your “wp-config.php” file. I added it at the end of mine.
if(is_admin()) {
add_filter('filesystem_method', create_function('$a', 'return "direct";'));
define( 'FS_CHMOD_DIR', 0751 );
}
Good luck!

