Public and Private Keys are Incorrect for user

For some time, I’m getting the error Public and Private keys incorrect for wp-user when I try to update a plug-in.

I’ve a CentOS 7 VPS setup with a LAMP stack. I’ve installed and configured my WordPress installation which works fine except that I can’t update plug-ins or make image uploads via the WordPress control panel.

I let WordPress access to my server using SSH. I’ve followed this tutorial to do so. Basically there is a specific user in my system created for this task(making WordPress connect via SSH) and it has the SSH keys. According to the tutorial, the permissions of various files are all okay(I’ve double-checked) but nevertheless WordPress does not perform the operation.

What other configuration do I need?

Some other information:

  • the user for the WordPress SSH operation has a password so it can log-in via Ssh and it’s specifically allowed in ssh_config

3 Answers
3

I solved it! Finally after a lot of frustrating days.

In the tutorial page, deep down in the comments, someone suggested removing/commenting the following line:

define(‘FTP_PRIKEY’,’/home/wp-user/’);

I did this and immediately the error message disappeared and things started getting updated.

Leave a Comment