Using WP-CLI to maintain multiple sites over SSH

Not all hosts provide a simple way to update WordPress Core, Plugins, or Themes within their control panel so that leaves you logging in to each WordPress install one by one to push updates (Of course you can enable auto-updates in WordPress these days). There is another way of going about this if you like to have a little more control, and that is by using WP-CLI. WP-CLI allows for you to create a config.yaml file in the /User/home/username/.wp-cli/ directory on your computer that has WP-CLI installed.

The process of setting this up is pretty straightforward, first, you want to make sure for ease of use you push out your SSH key to each site/server that you will be connecting to else you are stuck typing in the password for each site which kind of defeats the purpose of this setup. I won’t explain this process as there are many walkthroughs out there that can help you get this going if you are unfamiliar, I even wrote a bash script to help with this process.

Read more

SSH Key generation script

For a short while, I found myself logging into multiple servers and anyone that is using passwords is simply doing it wrong. I was getting ready to remove password authentication on all my servers that I managed and decided to throw this simple script together to send my key to the servers before disabling passwords, …

Read more

Creating an SSH Tunnel

When connecting to MySQL sometimes the host does not allow for external connections to MySQL remotely for security reasons, but they do usually offer SSH access.

With SSH access you are able to create an SSH tunnel to your site/server and then connect to the port locally using your MySQL client of choice, mine being Sequel Ace on macOS.

Read more