How to Set Up SSH Access for WordPress Hosting
SSH lets you run WP-CLI and manage your WordPress site over an encrypted connection. Generate a key on macOS, Linux, or Windows, paste the public key into the hosting dashboard, then connect from your terminal.
SSH gives you direct, encrypted access to your WordPress server for WP-CLI, file operations, and automation. This guide covers key generation across operating systems, importing the key into Sparkforge hosting, and connecting from the terminal.
Why SSH
- Run WP-CLI for scripted plugin, cache, and CDN management
- Encrypted, key-based authentication (no passwords)
- Direct file operations without FTP
- Automation and deployment workflows
- Per-device key management for teams
Generate an SSH key
macOS
- Open Terminal.
- Run
ssh-keygen -t rsa. - Press Enter at every prompt to accept defaults (no passphrase needed).
- Copy the public key:
pbcopy < ~/.ssh/id_rsa.pub
Linux
- Open Terminal.
- Run
ssh-keygen -t rsaand accept defaults. - Install
xclipif needed:sudo apt install xclip(Ubuntu),sudo pacman -S xclip(Arch), orsudo yum -y install xclip(Fedora/CentOS). - Copy the public key:
cat ~/.ssh/id_rsa.pub | xclip -sel clip
Windows
- Open PowerShell.
- Run
ssh-keygen.exe -t rsaand press Enter at every prompt. - Copy the public key:
Get-Content .ssh\id_rsa.pub | Set-Clipboard
Add the key to your hosting dashboard
- Log in to your Sparkforge hosting dashboard.
- Open Advanced Settings → Server Settings.
- Toggle SSH Access on.
- Open SSH Keys Manager and click Import New Key.
- Paste your public key, name it (e.g. "Jane's MacBook"), and click Import.
Connect via SSH
- Grab the host/IP and username from the dashboard.
- Open your terminal.
- Run
ssh yourusername@yourhostip. - Type
yesto confirm the host fingerprint on first connection. - Move into the WordPress directory:
cd public_html.
Common WP-CLI commands
- List plugins:
wp plugin list - Clear cache:
wp cache flush - Purge CDN cache:
wp cdn purge
Managing keys
Use the SSH Keys Manager to add keys for additional team devices, delete keys for lost or stolen hardware, and rotate keys periodically. Each key is independent — revoking one doesn't affect others.
FAQ
Frequently Asked Questions
What if I lose my private key?
Generate a new key pair, add the new public key to the dashboard, and delete the old one from SSH Keys Manager.
Can I use a password instead of a key?
No. SSH on Sparkforge hosting requires key-based authentication.
How do I revoke access for a stolen device?
Open SSH Keys Manager and delete the key tied to that device immediately. Other keys keep working.
Is SSH available on every hosting plan?
Check your specific hosting plan. Some lower tiers may not include SSH access.
Do I need to restart anything after importing a key?
No. The key is authorized as soon as you click Import. Connect from your terminal right after.
Was this article helpful?
Thanks for the feedback.