SSH (Secure Shell) provides a secure way to connect to your server and manage your WordPress installation using command-line tools like WP-CLI. This guide will walk you through how to enable SSH access, create and add SSH keys, and connect to your site securely.


What is SSH and Why Use It?

SSH allows advanced users to:

  • Run WP-CLI commands for:

    • Plugin and theme management

    • Import/export data, clear caches, and update configurations

    • Manage files directly via the terminal.

⚠️ SSH is recommended for users familiar with the command line. Always proceed with caution when executing commands.



Step 1: Create Your SSH Key

SSH access on our platform only supports key-based authentication — no passwords are used for extra security.


On macOS 

If you use Mac, the first thing you need to do is to open a terminal. Once your terminal is open, you can copy and paste the following command:

ssh-keygen -trsa

Hit enter for all the options, you don't need to create a password. It should look like this(on Mac terminal is usually white instead of black, but should be the same):



Once your key is created, you can copy it to your clipboard:

pbcopy < ~/.ssh/id_rsa.pub


 On Linux:

  1. Open the Terminal.

  2. Generate your SSH key:

    bash
    CopyEdit
    ssh-keygen -t rsa

    Press Enter to accept all defaults.

  3. Copy your public key to your clipboard:

    bash
    CopyEdit
    pbcopy < ~/.ssh/id_rsa.pub # macOS cat ~/.ssh/id_rsa.pub | xclip -sel clip # Linux (requires xclip)


On Ubuntu:

sudo apt install xclip

On Arch Linux:

sudo pacman -S xclip

On Fedora/CentOS:

sudo yum -y install xclip

On Windows:

  1. Open PowerShell.

  2. Generate your SSH key:

    powershell
    CopyEdit
    ssh-keygen.exe -t rsa

    Press Enter through all prompts.

  3. Copy the public key:

    powershell
    CopyEdit
    Get-Content .ssh\\id_rsa.pub | Set-Clipboard


Step 2: Add Your SSH Key to the Hosting Dashboard

  1. Log in to your hosting dashboard.

  2. Go to the Advanced Setting -> Server Settings tab of your site

  3. Enable SSH Access (toggle on if not already).

  4. Scroll to SSH Keys Manager.

  5. Click Import New Key.

    • Paste your public key.

    • Add a name (e.g., “John’s MacBook”).

    • Leave the passphrase field blank unless you used one.

  6. Click Import, then the system will Authorize the imported key.





Step 3: Connect to Your Server via SSH

  1. Return to the Server settings tab to get your connection details:

    • Host/IP Address

    • Username

  2. Open your terminal and run:

    bash
    CopyEdit
    ssh yourusername@yourhostip

    Replace yourusername and yourhostip with your actual values.

  3. The first time, you may see a warning prompt. Type yes and hit Enter.

  4. Once connected, switch to your site’s directory:

    bash
    CopyEdit
    cd public_html

✅ Common Commands via WP-CLI (once connected)

  • List installed plugins:

    bash
    CopyEdit
    wp plugin list
  • Clear WordPress cache:

    bash
    CopyEdit
    wp cache flush
  • Purge CDN cache:

    bash
    CopyEdit
    wp cdn purge

Managing SSH Keys

  • Delete Key: Remove unused keys at any time from the SSH Keys Manager.

  • Import Additional Keys: Repeat the process for other devices or team members.

Tip: Regularly rotate your keys for improved security.


Troubleshooting Tips

  • Can’t connect? Double-check your key is authorized and the username/IP are correct.

  • Issues on Linux? Install xclip if clipboard commands fail.

  • Use ssh-add ~/.ssh/id_rsa if you're using a passphrase-protected key.


Need further help? Reach out to your Agency for assistance.