Updating ITS Web Hosting WordPress Sites Within the WP Dashboard

Environment

ITS Web Hosting

Issue

How do I update ITS Web Hosting WordPress sites within the WP dashboard?

Resolution

When working with WordPress sites hosted by ITS Web Hosting (based on AFS group home directories), it is not normally possible to add or update WordPress plugins or themes within the WordPress dashboard (eg, /wp-admin).  This is due to the AFS permissions model, which is different from that used by other filesystems on unix/linux (WordPress doesn't expect AFS).  In the AFS permissions system, the webservers use the "umweb:servers" kerberos principal to access the WordPress installation.  Because AFS permissions are directory-based rather than file-by-file, incorrectly permitting AFS can make your WordPress site vulnerable to compromise.

It is still possible to perform installations and updates via the linux command line, but for users who prefer an easier option, there is a WordPress plugin that can help.  

https://wordpress.org/plugins/ssh-sftp-updater-support/

You need to do the initial installation of this plugin via the command line, but once it is in place, you can do further installs and updates from with the WordPress dashboard.  Instead of using the default umweb:servers kerberos credentials, you'll provide the credentials for your own uniqname.  

To install this plugin via the command line, you'll need to:

  • Make an SSH connection to "login.itd.umich.edu" 
    • Windows: Use SSH Secure Shell software. For more information, see Using SSH Secure Shell to Connect to Host Computers [Windows].
    • Mac OS X: Mac OS X comes with SSH software called Terminal. Open the Applications folder, then the Utilities folder to find it. Open Terminal and enter this command: ssh uniqname@login.itd.umich.edu (use your own uniqname, not "uniqname"!)
  • Navigate to your wordpress "plugins" directory with a command like
    • cd ~groupdirectoryname/Public/html/wp-content/plugins (use your group directory name in that command, and your wordpress might be installed under "Private/html" or another path, of course.)
  • Download the "SSH-SFTP-Updater-Support" plugin to that location:
    • /usr/bin/wget https://downloads.wordpress.org/plugin/ssh-sftp-updater-support.0.8.2.zip
  • Uncompress that file:
    • unzip ssh-sftp-updater-support.0.8.2.zip
    • rm ssh-sftp-updater-support.0.8.2.zip
  • Add the following code near the top of your wp-config.php file:
    • define('FS_METHOD', 'ssh2');
  • Now that the plugin is in place, you can activate it from the /wp-admin/plugins.php page on your site

Once the plugin has been activated, you'll see new options whenever you attempt to install a plugin or theme, or update wordpress core/plugins/themes:

The values you need to provide to use the plugin are:

  • Hostname:  sftp.itd.umich.edu
  • FTP/SSH Username:  your uniqname
  • FTP/SSH Password:  your UMICH (Level 1) password
  • SSH Authentication Keys:  These should be left empty
  • Connection Type:  SSH2

Click "Proceed" to perform the desired operation using your personal credentials.  

Additional Information

Need additional information or assistance? Contact the ITS Service Center.

Details

Article ID: 3148
Created
Mon 7/13/20 2:28 PM
Modified
Wed 4/21/21 12:32 PM