VS Code's Remote - SSH extension runs a small VS Code server on the server. That needs a full shell; the standard chrooted access has no room for it. With the standard access, use an SFTP extension instead, or ask us for a full shell.
Before you begin
Your key is on your site, and an entry for it in ~/.ssh/config (see Connect with the macOS Terminal).
Steps
- In VS Code, open Extensions and install Remote - SSH (by Microsoft), or an SFTP extension such as SFTP by Natizyskunk.
- Remote - SSH: press F1, choose Remote-SSH: Connect to Host and pick the host from your
~/.ssh/config. - Choose Linux as the platform and open the folder
httpdocs. - SFTP extension: press F1, choose SFTP: Config, enter the host,
"port": 7822, your login,"privateKeyPath"and"remotePath": "/httpdocs", and save. - Edit and save files; they go to the server.
Result
You edit your site's files directly in VS Code.
What to do next
Caution
Changes are live at once. On an Exponential site, prefer changes in a copy, and keep backups in mind (see Restore your site from a backup).
Related articles
- Connect with the macOS Terminal or a Linux terminal Sign in over SSH and copy files with sftp and scp from the Terminal on a Mac or any Linux computer.
- Restore your site from a backup Bring back a deleted page, a broken update or lost files from one of your site's restore points.