VSCode

How to Use VSCode With Remote SSH

How to Use VSCode With Remote SSH

VSCode Remote SSH keeps VS Code on your own computer and points it at files that sit on a server somewhere else. Once the extension is installed and a key is on the host, Remote-SSH: Connect to Host in the Command Palette does the rest.

The files stay on the host, along with terminals and debug sessions. Build servers and cloud virtual machines are the obvious use.

Older servers are the catch. Since VS Code 1.99 (March 2025), Microsoft’s Remote Development FAQ says the prebuilt VS Code Server needs glibc 2.28 or later on Linux hosts, so Ubuntu 18.04 and CentOS 7 servers are unsupported without a workaround.

How VSCode Remote SSH Works

YouTube player

Microsoft’s extension opens a folder on any remote machine that has a running SSH server, and you get VS Code’s full feature set on that folder.

The editor window stays on your computer. The work happens on the host.

The VS Code interface runs locally, and so do UI-side extensions such as themes and snippets. The local SSH client opens the connection. Files live on the host. Terminals and debug sessions run there too, and so do most extensions, which get installed next to the VS Code Server. The server hosts the extensions that work directly with the remote workspace and file system.

VS Code installs the server automatically on the first connection. By default it downloads the server on the remote host, then falls back to downloading locally and transferring it if that fails.

Traffic between client and server travels through an authenticated SSH tunnel, and the server runs as the user who signed in.

That setup suits a large codebase on a build server or GPU box. Nothing gets copied to your laptop, and indexing and test runs use the host’s CPU.

Remote – SSH ships in the Remote Development pack for Visual Studio Code, alongside Remote – Tunnels, WSL and Dev Containers.

Connect only to hosts you trust. Microsoft warns that a compromised remote can use the connection to execute code on your local machine.

What You Need Before Connecting

The local machine needs an OpenSSH-compatible client. The remote host needs an SSH server, plus outbound HTTPS access so the VS Code Server can download.

Which remote hosts are supported

Support follows the glibc baseline.

Microsoft’s Remote Development FAQ puts the prebuilt server at glibc 2.28 or later since VS Code 1.99 (March 2025). The Linux host page adds kernel 4.18 or later and libstdc++ 3.4.25 or later.

Any machine with an SSH server qualifies, including a virtual machine, as long as its operating system meets these requirements as of November 2026.

On Linux, Ubuntu Server 20.04, Debian 10, RHEL 8, CentOS 8, Oracle Linux 8, openSUSE Leap 15 and SLES 15 all work. Ubuntu Server 18.04, Debian 9, CentOS 7, RHEL 7 and Oracle Linux 7 don’t.

Windows 10/11 and Server 2016/2019 (1803+) are fine with the official OpenSSH Server. macOS needs 10.14 (Mojave) or later with Remote Login turned on.

Alpine is not supported for Remote – SSH. It only works with Dev Containers and WSL.

32-bit ARM is a special case. VS Code 1.122 is the last release with prebuilt servers for it, and from 1.123 the host must run x86_64 or ARM64 Linux.

Extensions that ship x86-only native code can fail on ARM hosts.

On an unfamiliar host, run ldd --version before anything else. A result below 2.28 puts the host outside the supported list. Honestly, this one check saves more time than any other step in the article.

Local machine and network

You need an OpenSSH client on your PATH. PuTTY is not supported. On Windows, ssh.exe from Git for Windows or the OpenSSH client works.

The host needs outbound HTTPS on port 443 to update.code.visualstudio.com and vscode.download.prss.microsoft.com. Extensions also need outbound HTTPS to marketplace.visualstudio.com and *.gallerycdn.vsassets.io.

A host without Marketplace access can still get extensions through manually installed VSIX files.

The Visual Studio Marketplace listing sets the memory floor at 1 GB of RAM, with 2 GB and a 2-core CPU recommended. Plan for the recommended figure on any host you use daily.

Installing the extension

Install Remote – SSH from the Extensions view, or run ext install ms-vscode-remote.remote-ssh in Quick Open.

A new Remote indicator then appears at the far left of the Status bar.

The Remote Development extension pack is optional. Add it only if you also plan to use WSL or Dev Containers.

How to Set Up SSH Key Authentication

YouTube player

Key authentication swaps the password for a key pair. You generate it locally and copy the public half to the host, and the private key never leaves your machine.

Microsoft recommends keys for Remote – SSH, and VS Code does not save passwords or tokens for other authentication methods. A password login therefore prompts on every connect. I’d use keys even for a throwaway VM, since retyping a password on every reconnect gets old fast.

  1. Run ssh-keygen -t ed25519, accept the default location under .ssh, and set a passphrase or leave it blank. Fall back to ssh-keygen -t rsa -b 4096 only on legacy systems without Ed25519.
  2. Append id_ed25519.pub to ~/.ssh/authorized_keys on the host. On Linux and macOS, ssh-copy-id user@host does this in one command.
  3. Locally, set .ssh to 700 and keys and config to 600. On the server, set .ssh to 700 and authorized_keys to 600. Windows needs ownership and access checks instead.
  4. Run ssh user@hostname in a terminal and confirm it logs in without a password prompt.
  5. If the key carries a passphrase, load it into ssh-agent so VS Code does not prompt on each connection.

Passphrases, agents and prompts

Start ssh-agent locally on Windows, Linux or macOS, then confirm it is reachable with ssh-add -l.

When a two-factor, password or passphrase prompt stays hidden, turn on remote.SSH.showLoginTerminal. Keys made in PuTTYgen need exporting to OpenSSH format before you reuse them.

A dedicated key for development hosts is worth setting up too. One key per host group costs a few minutes and limits a leak to that group.

How to Connect to a Remote Host in VS Code

YouTube player

Run Remote-SSH: Connect to Host… from the Command Palette, enter user@hostname, and VS Code opens a new window attached to the host.

Test the plain connection first with ssh user@hostname in a terminal. A failure there points at your key or the host’s network setup, not at VS Code.

  1. Press F1 (or Ctrl+Shift+P, Cmd+Shift+P on macOS) and run Remote-SSH: Connect to Host…, or click the Remote indicator at the bottom left.
  2. Choose Add New SSH Host, then enter the host name or the full ssh command.
  3. Pick the config file that stores the entry. A custom path goes in remote.SSH.configFile.
  4. Select the host’s platform if asked. VS Code saves the choice to remote.SSH.remotePlatform.
  5. Wait while VS Code initializes the server. The Status bar then shows the hostname.
  6. Choose File > Open Folder and browse the remote home directory.

The first connection takes the longest. VS Code creates $HOME/.vscode-server on the host and uploads the server there.

Saved hosts appear in the Remote Explorer under SSH Targets, so you enter user and hostname only once. File > Close Remote Connection ends the session.

Microsoft’s own tutorial runs this flow against an Azure Linux VM, but the host can live anywhere that meets the Linux requirements.

How to Manage Hosts and Jump Servers in the SSH Config File

The SSH config file gives each server a short alias. The Host line is the nickname you type, and HostName holds the real address. Add User and you stop typing the login name every time.

Open it from the Command Palette with Remote-SSH: Open Configuration File… and pick the file when VS Code asks.

Core directives

Host devbox
HostName 203.0.113.10
User deploy
Port 22
IdentityFile ~/.ssh/id_ed25519

HostName can be an IP address or a DNS name. User is the login name for that host, and Port defaults to 22. IdentityFile points at a private key. You can list several directives and they are tried in sequence, and the default list already includes id_rsa and id_ed25519.

Set IdentityFile explicitly whenever a host uses a dedicated key. Microsoft’s own example points it at ~/.ssh/id_rsa-remote-ssh.

Jump hosts with ProxyJump

ProxyJump connects to the jump host first, then forwards the TCP connection to the final target. Several hops are separated by commas and visited in order.

Host bastion
HostName bastion.example.com
User deploy

Host internal-box
HostName 10.0.0.5
User deploy
ProxyJump bastion

ProxyCommand is the older route. Brown University’s CCV docs still use ProxyCommand ssh -q -W %h:%p jump-box for their VS Code node.

Microsoft’s official docs leave a gap here. The troubleshooting page has no jump host section and covers only ProxyCommand for proxy setups. If both directives appear, whichever is specified first takes effect.

Agent forwarding and connection reuse

ForwardAgent yes lets tools such as Git on the remote use your local keys. The default is no, and OpenSSH warns that users who can bypass file permissions on the host can reach the forwarded agent.

Set it per trusted host, never under Host *.

ControlMaster, ControlPath and ControlPersist cut repeated prompts on macOS and Linux. ControlPersist defaults to no, so the master closes with the first client unless you give it a time value or yes.

One failure mode sits in the file itself. Docker’s sandbox docs report that VS Code can leave duplicate or malformed blocks in the SSH config after Add New SSH Host, which surfaces as a KnownHostsCommand error or “Host key verification failed”.

Docker’s fix is to delete the managed block and regenerate it with sbx setup ssh.

How Do Extensions, Terminals and Port Forwarding Behave on a Remote Host?

A local extension that has to run on the host shows up dimmed under Local – Installed until you press Install on it. Terminals and debug sessions open on the host, and host ports reach your machine through forwarding.

Extensions on the host

Install Local Extensions in SSH: {Hostname} copies your selected local extensions to the host in bulk. If you want some on every host, remote.SSH.defaultExtensions lists extension IDs that install on each SSH host.

remote.extensionKind pins an extension to “ui” or “workspace”. Microsoft warns it can break extensions and positions it mainly for testing, so I’d leave it alone unless you have a specific reason.

Each of your VS Code extensions installed on a shared host adds load there. Oregon State’s CQLS docs ask users to remove all but the extensions they need from Default Extensions If Installed Locally, to cut I/O on the shared vs-gateway machine.

Terminal and debugging

Debug sessions run on the host, not on your machine. The Remote Development extensions run commands and other extensions directly on the remote machine, so the experience feels like running locally, according to Microsoft’s remote overview.

When you open the integrated terminal, the shell lands on the host as well.

Missing toolchain variables are the usual surprise. Intel’s oneAPI guide sources setvars.sh from a script before the VS Code backend starts, so the backend and its extensions inherit the oneAPI environment.

Port forwarding

GoalMethodLasts
Forward a port onceOpen the Ports view (Ports: Focus on Ports View in the Command Palette), then select Forward a PortCurrent session
Restore forwards on reconnectTurn on remote.restoreForwardedPortsAcross reconnects
Fix a busy local portRight-click the tunnel, then Change Local Address PortCurrent forward
Keep a forward permanentlyLocalForward in the host’s SSH config blockEvery connection

The local port can differ from the remote one when the original is already in use.

A permanent forward looks like LocalForward localhost:8080 localhost:3000. Binding to localhost keeps the forward reachable from your machine only.

Use the Ports view for one-off dev servers, and LocalForward for the database tunnel you open every morning.

Why Does VSCode Remote SSH Fail to Connect?

Most failures trace back to a broken VS Code Server install, key and permission problems, host-side network rules, or an operating system below the supported baseline.

SymptomCauseFix
Hang, timeout or “VS Code Server failed to start”Broken server install or a hidden promptRun Remote-SSH: Kill VS Code Server on Host, then reconnect. Check remote.SSH.showLoginTerminal
Permission denied (publickey)Key missing from authorized_keys, wrong IdentityFile or loose permissionsRun ssh -v user@host in a terminal and fix the first failing step
“administratively prohibited: open failed”sshd blocks TCP forwardingAdd AllowTcpForwarding yes to the host’s sshd config and restart sshd
Windows host misidentifiedWindows OpenSSH server read as another platformSet remote.SSH.useLocalServer to false, or remote.SSH.remotePlatform to “windows”
Install script cannot run/tmp mounted noexecAsk the admin to change the mount
Connection lands in the wrong shellA startup file launches another shellChange the default shell with chsh instead
Host behind a proxyNo direct routeProxyCommand in the local config, plus HTTP_PROXY and HTTPS_PROXY in ~/.bashrc on the host

Microsoft’s troubleshooting page has no dedicated permission denied section, so start from the key and file permission checks.

A stuck install sometimes survives the Kill command. Microsoft documents a manual cleanup that removes ~/.vscode-server and its processes, and MIT CSAIL’s TIG kills the stale vscode-server processes from a plain terminal session.

Git hangs and load-balanced hosts

A pull or sync can freeze when the repository was cloned over SSH with a passphrase-protected key. Microsoft’s workarounds are a key without a passphrase or cloning over HTTPS, and running git push from the command line also gets around it.

Behind a load balancer, connections can route to different nodes. Microsoft’s fix on macOS and Linux is ControlMaster, so both connections share one path.

The glibc conflict between Microsoft’s pages

Microsoft’s pages disagree on the Linux baseline.

The SSH overview page lists kernel 3.10+, glibc 2.17+ and libstdc++ 3.4.18+, with a host list that starts at Debian 8+, Ubuntu 16.04+ and CentOS/RHEL 7+. The Linux requirements page and the FAQ ask for kernel 4.18+, glibc 2.28+ and libstdc++ 3.4.25+, and they mark Debian 9, CentOS 7 and RHEL 7 as unsupported.

Treat the stricter page as the working rule. CentOS 7 passes the overview page’s host list and still lands on the unsupported list.

Remote – SSH can still connect to unsupported hosts if you supply a sysroot with the required libraries, which Microsoft calls a technical workaround that it does not officially support. It relies on VSCODE_SERVER_CUSTOM_GLIBC_LINKER and VSCODE_SERVER_CUSTOM_GLIBC_PATH for the libraries, with VSCODE_SERVER_PATCHELF_PATH pointing at patchelf.

The workaround uses patchelf, and versions 0.17.x are known to cause segfaults. Use 0.18.x or later.

When Is Remote SSH the Wrong Choice?

Remote SSH is the wrong tool when the host offers no SSH access, or when you need an isolated toolchain more than a specific machine. Shared login nodes are a gray area, and the HPC examples below show why.

OptionNeedsBest forLimit
Remote – SSHSSH server and a network routeMatching the deployment OS or using larger, specialized hardwareHost must meet the Linux baseline
Remote TunnelsGitHub or Microsoft sign-in on both endsReaching a machine without configuring SSHOne client at a time
WSLWindows PC with WSLDeveloping Linux-deployed apps from WindowsLocal machine only
Dev ContainersDocker on the hostIsolated, repeatable toolchainsA container layer to maintain
GitHub CodespacesGitHub accountA hosted environment with no server to runMetered compute and storage

Shared login nodes and heavy jobs

HPC centers show where Remote – SSH stops fitting. The connection lands on a login or gateway machine that many users share.

The University of Florida’s UFIT-RC no longer recommends the Remote-SSH plugin for HiPerGator and points users to Remote Tunnels. At Oregon State CQLS, tunnels run on compute nodes and respect queuing-system allocations, while Remote – SSH runs on the shared vs-gateway machine. Users with R or other CPU- and memory-heavy work are asked to switch.

On a server you control, Remote – SSH stays the simplest path. On a shared login node, start with Tunnels.

What Remote Tunnels costs you

Tunnels need no SSH setup, and the connection is outbound only, so firewall changes are generally unnecessary. Source code can stay off the client too.

The downsides are real, though. Both ends need a GitHub or Microsoft account, and accounts are limited to 10 registered tunnels, a limit Microsoft flags as subject to change.

The UI path works only while VS Code runs on the machine, and the CLI tunnel stops on Ctrl+C. Keep it running with code tunnel service install, and add --no-sleep to code tunnel to stop the machine from sleeping.

Dev Containers and Codespaces

Microsoft’s remote overview pitches Dev Containers for isolated toolchains and consistent environments, and for onboarding new contributors. They also stack on SSH. With a Linux or macOS host, Remote – SSH and Dev Containers together open a host folder inside a Docker container.

If you want no server at all, GitHub Codespaces hosts the environment for you.

GitHub’s billing docs list 120 core hours and 15 GB-month of storage on Free personal accounts, and 180 core hours and 20 GB-month on Pro. A core hour is active time multiplied by the machine’s core count, so 120 core hours is 60 hours on a 2-core codespace.

When you only have file access

If all you have is SFTP, Microsoft suggests the SFTP extension combined with remote debugging for Node.js, Python or C#.

SSHFS mounts the remote filesystem. Microsoft recommends it for single-file edits and uploads or downloads, not bulk operations. rsync keeps a local copy, which suits source control tools.

Common Questions About VSCode Remote SSH

Is Remote – SSH free to use for work projects?

Yes. Microsoft’s FAQ says you are free to use the extensions for personal or corporate use when connecting to your own machines, VMs or containers.

The extensions are not open source, and building a public product or service on them is not permitted.

Can I use the Remote – SSH extension in Cursor or VSCodium?

No, not with Microsoft’s extension. The VS Code Server is not licensed for use by other clients, and Cursor’s support forum points its users to the Anysphere Remote-SSH extension.

Microsoft’s FAQ does not mention forks by name.

How do I open a remote folder from the terminal?

Pass a remote URI to the code command once the host is configured: code --remote ssh-remote+remote_server /code/my_project.

A trailing slash or --folder-uri forces a folder open, and --goto or --file-uri forces a file open.

How do I install a downloaded extension file on a remote host?

Connect to the host, then run Extensions: Install from VSIX… from the Command Palette, exactly as you would locally. It works without internet access on the host.

Add "extensions.autoUpdate": false to settings.json to stop Marketplace updates from replacing it.

Can Remote – SSH connect to a host with no internet access?

Yes for the server, with limits. VS Code falls back to downloading the server locally and transferring it, and remote.SSH.localServerDownload controls that behavior.

Microsoft’s troubleshooting page still lists a host without internet as a failure cause, so test the connection and install extensions from VSIX files.

How do I uninstall the VS Code Server from a host?

Run Remote-SSH: Uninstall VS Code Server from Host… from the Command Palette. It stops the server processes and deletes the install folder.

The manual route is to kill the processes, then run rm -rf $HOME/.vscode-server. Insiders builds use ~/.vscode-server-insiders, and older versions installed under ~/.vscode-remote.

Keeping VSCode Remote SSH Working After Updates

The cheapest fix is checking the host’s operating system before the client updates, not after a connection fails. Microsoft’s Linux requirements page, checked on November 19, 2026, is the page to verify against.

Start with the host’s glibc and OS support, since a failed baseline blocks every other fix. After that, back up your SSH config and settings.json so a rebuilt workstation reconnects unchanged. Kill VS Code Server on Host is your reset button, and VSIX copies of key extensions make good fallbacks.

Keep host-level values such as remote.SSH.remotePlatform and remote.SSH.defaultExtensions where you can open settings.json in VSCode and review them after each update.

The sysroot workaround keeps a legacy server reachable, but Microsoft does not officially support it, so each upgrade becomes your own maintenance job. Another baseline increase would reorder these checks, so re-verify the requirements page after every major VS Code release.

Bogdan Sandu

Stay sharp. Ship better code.

Every week: one curated article, one tool worth knowing, one tip you can use tomorrow. No noise, no padding.