wag0325
By:
wag0325

Installing themes on wordpress requires FTP/SSH credentials

April 10, 2017 560 views
WordPress Nginx Ubuntu

I'm asked to enter in FTP/SSH credentials for installing themes on Wordpress. I've installed the wordpress with nginx and SSH key, and I tried copying and pasting the private and public keys to the input boxes, but that didn't work.

I'm using the root user and changed ownership of the directory /var/www/html.


Installing Theme:

Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP or SSH credentials to proceed. If you do not remember your credentials, you should contact your web host.

Hostname
FTP/SSH Username
FTP/SSH Password This password will not be stored on the server.

Connection Type
FTP FTPS (SSL) SSH2

Authentication Keys
Public Key:
Private Key:

Enter the location on the server where the public and private keys are located. If a passphrase is needed, enter that in the password field above.

2 Answers
ryanpq MOD April 10, 2017
Accepted Answer

WordPress will ask for these credentials if it detects that it does not have permission to write the needed files itself. This can be avoided completely by resetting these permissions so the files are owned by the user account used by your web server.

If you are on Ubuntu or Debian you can run the following command on your droplet to set these permissions for the default web root of /var/www/html

chown -Rf www-data:www-data /var/www/html

Once this is run you should no longer see the message prompting for credentials when installing themes.

As it says: "Enter the location on the server where the public and private keys are located"

  • I currently have my public/private keys on my local. Is it safe to upload them to the server? (I'm new to using SSH).

    • I'm not familiar with Wordpress, but if your permissions are correct this shouldn't be necessary.

Have another answer? Share your knowledge.