With SSH access you get a command line on the server for your hosting account: run WP-CLI, copy files between your live and staging sites, export a database, read configuration files or check how a site answers. The command line is jailed to your account: you see your own files and a set of programs, nothing else of the server.
Requesting it
- In the Control Panel, open SSH access (in the Files and databases group).
- Choose the key that will open the command line: one of the keys you already use for SFTP, or paste a new public key (see Create an SSH key and add it to your account).
- Request SSH. Our staff review the request; once they approve it, an administrator switches it on on the server. You can follow it under Requests.
Only that one key opens the command line. Your other keys keep working for SFTP only, and so does a key you add later. To use another key for the command line, switch SSH off and request it again with that key.
Logging in
ssh <your user name>@services.maplegrovepartners.com
SSH access shows the exact command with your user name, and a Copy button. On Windows, PowerShell has ssh;
PuTTY works too, with your key.
SFTP works as before, also with the command line key. With SSH on, SFTP programs show your files under
/home/<your user name>, so a folder saved in FileZilla or WinSCP may need updating.
Where your files are
- Your files are in
/home/<your user name>, each site in its own folder (for example~/example.com). Work inside your site folders: the top level of your home belongs to the server, so you cannot create files there. /tmpis your own private temporary folder; it counts towards your disk space. Put database exports and other files that must not be on a website there, and delete them when you are done. Never leave an export in a site folder, where anyone could download it.- Programs you upload or create cannot be run. Scripts run through their program:
php script.php,bash script.sh.
What you can use
File tools (ls, cp, mv, rm, mkdir, find, grep, sed, awk, diff, du, chmod and more), rsync,
tar, gzip, zip and unzip, the editors nano and vim, less, curl, php, WP-CLI (wp) and the MySQL
client (mysql, mysqldump). The SSH access page lists exactly what is there. There are no compilers, no ssh or
scp to other servers, and no scheduled tasks (cron).
Common tasks
WordPress with WP-CLI:
cd ~/example.com
wp plugin list
wp plugin update --all
wp cache flush
Copy a theme you changed on the staging site to the live site (take a backup of the live site first):
rsync -a ~/staging.example.com/wp-content/themes/mytheme/ ~/example.com/wp-content/themes/mytheme/
Export a site's database, and import it into another of your sites:
wp --path=$HOME/example.com db export /tmp/example.sql
wp --path=$HOME/staging.example.com db import /tmp/example.sql
rm /tmp/example.sql
Careful: importing replaces the whole database of the site you name. After the import above, the staging site holds
the live site's addresses; change them with wp search-replace, or simply copy live to staging from the Control Panel
(see Try changes on a staging site first).
Check how a site answers: curl -I https://example.com.
Limits
- At most 4 logins at a time.
- All your sessions together can use one processor core and 2 GB of memory, so a long task may run slower than on your own computer.
Switching it off
Switch SSH off under SSH access. Open sessions end at once, and your keys keep working for SFTP. Switch it off when you no longer need it, or if your key may be in someone else's hands (then also remove that key under SFTP and SSH keys).