Question

Allowing Wordpress to update/install with SSH Keys

Hi,

Can anyone help with this.

I am using centOS on a small droplet with a couple of Wordpress installs, I have SSH Keys set up however I don’t want to use FTP to allow Wordpress access to auto updates and plugin installs.

There must be a solution for this but I cannot find anything really useful on the net. Any ideas?


Submit an answer


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!

Sign In or Sign Up to Answer

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.

You have two options to bypass FTP.

1. First one is using Direct write to wp-content directory

This method doesn’t require FRP or SSH, it directly writes to wp-content directory. You must ensure before using this method that you does have sufficient permissions to write to wp-content. Usually you would go with setting ownership to regular user (e.g. sammy) and group to apache (apache is CentOS equivalent to Ubuntu’s www-data).

This is done by following command:

  1. sudo chown -R sammy:apache /var/www/html

After you make sure it is setup correctly you will have to change wp-config.php. Find FS_METHOD and change its value to direct. It should look like -> define('FS_METHOD', 'direct);

2. First one is using SSH/SFTP write to wp-content directory

There is How To Configure Secure Updates and Installations in WordPress on Ubuntu by DigitalOcean. It is for older version but it still should do its job. Keep in mind if you are using php7 to use equivalent packages for it.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

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

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.