GHL-Hosted WordPress — SSH and WP-CLI Access
Overview
- What: Establish a real SSH shell to a GHL-hosted WordPress site and run WP-CLI for maintenance the wp-admin UI can't do efficiently (bulk plugin/option/cron operations, database export, indicator-of-compromise sweeps, sitemap debugging).
- When: Any time a maintenance task needs shell/WP-CLI rather than point-and-click admin — e.g. removing orphaned plugin data, unscheduling leftover crons, scripted plugin audits, or taking a CLI database backup before a risky change.
- Who: Web Specialist (with GHL hosting-panel access and the site's wp-admin login).
- Time Required: ~15 min first-time setup per operator machine; under 1 minute to connect thereafter.
Background — the four access layers (this is what trips people up)
GHL-hosted WordPress is real WordPress, and GHL exposes several distinct access channels. They are easy to confuse, and confusing them is the #1 cause of wasted time here:
| Channel | What it gives you | Host / Port | Username pattern |
|---|---|---|---|
| wp-admin (browser) | Plugin install/activate, settings — UI only | https://<domain>/wp-admin | a WordPress admin user |
| FTP | File transfer only (no shell) | host, port 21 | <something>ftp@<host> |
| SFTP | File transfer over SSH (no shell) | host, port 22 | varies |
| SSH + WP-CLI | Full shell + wp commands | IP/host, port 22 | a numeric account (e.g. xgz4ici) |
Hard-won traps:
- Port 21 is FTP, port 22 is SSH.
ssh … -p 21will just hang — it's speaking SSH to a port that answers in FTP. - A username like
<site>ftp@…plus port 21 is a file-transfer account, not a shell. WP-CLI needs the SSH shell account (the numeric one). - SFTP ≠ SSH shell. SFTP moves files; it does not run
wp. - The SSH connection details (host / port 22 / numeric username) and the SSH key registration live in the GHL hosting panel under SSH Access / Manage SSH Keys — a different place from the FTP credentials.
- The WordPress root is typically `[LOCAL_PATH_REMOVED]
Prerequisites
- GHL hosting-panel access for the target site (
app.symphonycore.com→ WordPress hosting management). - The site's wp-admin admin login (from 1Password).
- An SSH keypair on the operator's Mac at
~/.ssh/id_ed25519. Check withls ~/.ssh/*.pub; create one if absent:ssh-keygen -t ed25519 -C "<operator-or-machine-label>". - All credentials pulled from 1Password per the 1Password Config Standard. Never type or paste passwords, private keys, or key passphrases into chat tools or anything that produces a transcript.
Procedure
A. Get the SSH connection details
- In the GHL hosting panel for the site, open SSH Access. Record: Host (an IP or
*.wpdns.site), Port (22), Username (numeric, e.g.xgz4ici). - Note the WP root: usually `[LOCAL_PATH_REMOVED]
B. Register your SSH public key (preferred — key auth)
- Copy the public key to the clipboard:
pbcopy < ~/.ssh/id_ed25519.pub. (Public key only. The private key and its passphrase never leave the operator's machine.) - In Manage SSH Keys: paste into the Public Key box, set a Key Name, and leave Key Passphrase blank — registering a public key does not require your private-key passphrase, and it should not be handed to the host.
- Click Import.
- If "Unable to import SSH key — duplicate key": a stale/old key already occupies that name. Delete the existing key entry first, then re-import. Confirm the registered key matches your local one by comparing fingerprints:
ssh-keygen -lf ~/.ssh/id_ed25519.pub.
C. Connect
ssh <username>@<host> -p 22- First connection only: it shows the server's host-key fingerprint and asks to continue — type
yes(added to~/.ssh/known_hosts). - If the key is accepted you land at the server shell (macOS may prompt locally for your key passphrase — that is normal and stays on your machine).
- If instead it prompts
<username>@<host>'s password:→ key auth did not take. That prompt is the server account password, not your key passphrase. Two options:- Fastest: enter the SSH/account password for the numeric user from the GHL panel (type it into Terminal, never into a chat).
- Cleaner: fix the key registration (step B4) so future connects are passwordless.
- Diagnose with
ssh -v <username>@<host> -p 22: lines readingOffering public key … Authentications that can continue: …,passwordthenNext authentication method: passwordmean the server rejected your key (the registered key ≠ your local key).
D. Confirm WP-CLI
cd ~/public_html && wp --info→ prints WP-CLI version, PHP binary, and config path.- If
wp: command not found, try a bundled phar (php ~/wp-cli.phar --info) or confirm with the host whether WP-CLI is available. If it isn't, fall back to wp-admin + the panel's phpMyAdmin for the task.
Common WP-CLI operations (with safety net)
Always take a backup before any destructive operation:
# Explicit dated filename (don't rely on ambiguous defaults)
wp db export ~/<site>-2026-06-15-pre-change.sql && ls -lh ~/<site>-*.sql
| Task | Command |
|---|---|
| List plugins | wp plugin list --fields=name,status,version --format=table |
| Remove a plugin | wp plugin deactivate <slug> && wp plugin delete <slug> |
| Find orphaned options | wp option list --search='<prefix>*' --fields=option_name |
| Delete an option | wp option delete <option_name> |
| List scheduled crons | wp cron event list |
| Unschedule a cron | wp cron event delete <hook_name> |
| Admin-user audit (IoC) | wp user list --role=administrator --fields=ID,user_login,user_email,user_registered |
Re-run the relevant list command after each change to confirm, and spot-check externally where possible (e.g. curl -I https://<domain>/wp-content/plugins/<slug>/ should 404 after a delete).
Verification
wp --inforeturns versions → shell + WP-CLI confirmed.- For a maintenance change: the matching
wp … listreflects it, and an outside HTTP check (curl) agrees. - The pre-change
wp db exportbackup file exists and is non-zero.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
ssh connects then hangs / no shell | Pointed at port 21 (FTP) or used the *ftp username | Use the SSH host + port 22 and the numeric username |
Unable to import SSH key — duplicate key | A stale key holds that key-name slot | Delete the existing key entry, then re-import; verify fingerprints match |
Prompts for password: even with a key loaded | Registered key ≠ local key (or none registered) | Re-register the correct public key (B4), or use the account password |
Host key verification failed (non-interactive, e.g. a chat ! runner) | Host key not yet trusted, and no TTY to accept it | Connect once interactively in Terminal to accept the host key |
wp: command not found | WP-CLI not installed or not on PATH | Try the phar path; otherwise use wp-admin + phpMyAdmin |
Roles
| Role | Responsibility |
|---|---|
| Web Specialist | Operator — performs the access setup and runs the WP-CLI task. |
| Implementation Lead | Accountable for this SOP's correctness and for approving destructive maintenance. |
Related Documents
- WordPress Hosting Infrastructure — Agency Overview
- Set robots.txt for GHL Domains
- WordPress Setup SOP
- WordPress WSOD Recovery Runbook
- SC WordPress Stack Standard
- 1Password Config Standard
Document History
| Date | Version | Change | Author |
|---|---|---|---|
| 2026-06-15 | 1.0 | Initial — SSH + WP-CLI access to GHL-hosted WordPress: four-layer access disambiguation (wp-admin / FTP / SFTP / SSH), public-key registration with the duplicate-key fix, key-rejected→password fallback, and a WP-CLI maintenance quick-reference. | Symphony Core Systems Team |