SSH Keys, Wordpress, SFTP, Connection Information?

The article here: https://www.digitalocean.com/community/tutorials/how-to-configure-secure-updates-and-installations-in-wordpress-on-ubuntu The status of the article is marked as deprecated.

I’m using SSH Keys and in my Wordpress install when trying to update plugins, it’s asking for: https://cl.ly/3G2m363d203A “Connection Information” via SFTP.

Since I’m using SSH Keys how would I go about this?

hi Kutakizukari,

First of all this issue here have nothing to do with virtualmin… its your own setup however if you would do read wp docs you would found that this issue is not really issue… I will help you solve this problem, please follow this:

Specify FTP and SSH information in wp-config.php

Depending on your host’s setup, WordPress may ask you for FTP information whenever you try and update/upload something or you may just prefer to use SSH instead of FTP. So you can use all of the following definitions to define, in order:

  • FileSystem Method – either direct, ssh2, ftpext or ftpsockets
  • FTP Base – where your WordPress installation is located
  • Content Directory – set the location of your wp-content folder
  • Plugin Directory – set the location of your plugins folder
  • Public Key – the location of your SSH public key
  • Private Key – the location of your SSH private key
  • FTP User – the FTP or SSH username
  • FTP Pass – the password associated with the FTP User (not needed for SSH public key authentication)
  • FTP Host – the host and port of your FTP/SSH server (FTP port defaults to 21 and SSH to 22 if not specified)
  • FTP SSL – use SFTP, if supported by your server

…in your configuration the whole code should looks like this - more or less… please use your logic and your own settings, to replace default values in code.

define('FS_METHOD', 'ftpext'); define('FTP_BASE', '/path/to/wordpress/installation/'); define('FTP_CONTENT_DIR', '/path/to/wp-content/'); define('FTP_PLUGIN_DIR ', '/path/to/wp-content/plugins/'); define('FTP_PUBKEY', '/home/username/.ssh/id_rsa.pub'); define('FTP_PRIKEY', '/home/username/.ssh/id_rsa'); define('FTP_USER', 'username'); define('FTP_PASS', 'password'); define('FTP_HOST', 'ftp.example.org:21'); define('FTP_SSL', false);

…just adjust those to your ssh connection and you should be up and running in no time.

Thank you unborn for the reply. I tried your suggestions with no luck.

I did get it solved though.

I followed the directions from here: https://www.virtualmin.com/documentation/users/server-owner

Windows graphical FTP clients / Filezilla

In Virtualmin -> Webmin -> Servers -> SSH Server

Access Control -> Only allow users -> add the above virtual server username

When I uploaded WordPress as root I guess there was a permission issue.

When I did the above and uploaded as that user the auto updates worked in WordPress like they should.