Report this

What is the reason for this report?

Wordpress SSH : Public and Private keys incorrect for wp-user

Posted on March 26, 2016

I followed the instructions for setting up SSH to the letter, even using the same username as wp-user.

When I try to install a plugin, it comes up with “Public and Private keys incorrect for wp-user”

I generated the key pair several times. Same problem!

When it didn’t work after several regens, I decided to generate my own using puTTY and then uploaded it to the /home/wp-user directory as wp_rsa, wp_rsa.pub.

In the Wordpress Connection Information page, it shows the following:

Hostname 127.0.0.1:22

FTP/SSH Username wp-user

FTP/SSH Password … (I did not give wp-user a password as instructed not to)

Authentication Keys

Public Key: /home/wp-user/wp_rsa.pub

Private Key: /home/wp-user/wp_rsa

Connection Type SSH2

==================

I’ve been at this from morning to now evening. Frustrating.

Anyone have any idea why this isn’t working? TIA.



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!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

As mentioned, setting the entire wordpress path to www-data:www-data is insecure. At the minimum, you can get this to work by just setting wp-admin/includes/file.php permissions to www-data:www-data

This question was answered by @rick741284:

SOLVED!!!

I’m posting this here so that if someone else has this frustrating problem this might solve it.

Here is what I found:

Try to give www-data permission in wordpress directory:

cd /yourwordpress_dir/ sudo chown -R www-data:www-data *

In my case, I had to cd /var/www/html and then sudo chown -R www-data:www-data *

:-)

View the original comment

Thank you for this - it also solved my problem :)

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.