Question

How to update wordpress plugin and theme while using SFTP SSH connection

Posted September 9, 2016 13.8k views
UbuntuWordPressUbuntu 16.04

I installed Ubuntu 14.4.5 x64 in a droplet i created and installed vestaCP to host mulitple wordpress sites. I am using SFTP and no FTP is used for security purpose. Problem came when i tried to update my plugins. I was asked for Hostname, FTP Username, FTP Password. i can give my IP as host name for username root but for password I need to upload the SSH file but there is no option for that. If there is any solution please give me the details.

3 comments
  • I have already read the tutorials… but I am using Nginx and my Apachi is desabled

  • You need to make files in your public folder writable by nginx user. Simply find the nginx user (default www-data) and change the folder ownership to that user. Your errors will go away.

  • Whenever i try to save the SSH key after giving the comment
    ssh-keygen -t rsa -b 4096
    it says “Saving the key failed’. i specified all my paths but its not helping.
    I am using nginx and already installed vestaCP in my ubuntu 14.4.5 x64.

    Here i shall specify my code samples that I used here.

    /home/marktx/web/mydomain/publichtml/wp-user/wp_rsa

    I am using this because i did not directly installed wordpress in the server but rather used vestacp to host multiple sites.

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.

×
2 answers

You need to change wp-config to use SSH, and specify user, SSH keys.

Also you should install php-dev, libssh2, libssh2-php to make it work.

Refer to How To Configure Secure Updates and Installations in WordPress on Ubuntu. It’s an older tutorial, but will help you

by Justin Ellingwood
WordPress is the most popular content management system (CMS) on the web currently. While WordPress can be a great way to manage you content, there are some very insecure configurations that are given throughout the internet. This article will cover how to set up secure updates and installations using SSH keys instead of FTP, which is an inherently insecure protocol.

I have already read the tutorials… but I am using Nginx and my Apachi is desabled

  • The tutorial should be same for both Apache and Nginx.
    All 3 packages are php based packages, so it is same for both Apache and Nginx and doesn’t make any difference.

    Only different step is that you don’t execute sudo service apache2 restart.
    In this situation you execute sudo service nginx restart

Submit an Answer