By quintessence
I followed the Digital Ocean tutorial for configuring secure updates for Wordpress using SSH keys and I am still being prompted for the FTP information when I try to install at new theme.
In the wp-config.php file I added:
define('FS_METHOD', 'direct');
define('FTP_PUBKEY','/home/wp-user/.ssh/wp_rsa.pub');
define('FTP_PRIKEY','/home/wp-user/.ssh/wp_rsa');
define('FTP_USER','wp-user');
define('FTP_PASS','wp-pass');
define('FTP_HOST','127.0.0.1:22');
Where wp-user and wp-pass have been replaced by the appropriate user name and password. The FS_METHOD line wasn’t in the tutorial, but something I saw suggested for related problems, e.g. here and here.
The permissions on the files are:
-rw-r--r-- 1 wp-user wp-user 755 Jul 16 21:03 authorized_keys
-rw-r----- 1 wp-user www-data 3326 Jul 16 20:57 wp_rsa
-rw-r----- 1 wp-user wp-user 738 Jul 16 21:00 wp_rsa.pub
The permissions on the ~/.ssh, var/www, :
drwx------ 2 wp-user wp-user 4096 Jul 16 21:03 .ssh
...
drwxrwxr-x 3 wp-user www-data 4096 Jul 13 13:51 www
I also prepended the RSA information in the authorized_keys file with from="127.0.0.1" and restarted apache with sudo service apache2 restart more times than I care to admit.
Is there anything else I should be doing?
Thank you!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
In your question, you state:
Where wp-user and wp-pass have been replaced by the appropriate user name and password.
By using ssh keys, there should be no password. Leave the password field blank (as it is in the tutorial you referenced).
Also, the tutorial instructs you to create and prepare a user called “wp-user”. If you were following that tutorial, that user should not be changed either, unless you did the same things to a different username.
{Edit}…
Additonally… FS_METHOD should not be changed to “direct” as this instructs the updater to use direct filesystem commands rather than the ssh method you spent all that time in the tutorial preparing. If you wish to explicitly set FS_METHOD, the value should be “ssh2”.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.