Remote SSH Connection Fails After Server Starts (Windows Remote Host)

Hi everyone,

I’m encountering an issue when connecting to a remote Windows machine via Cursor Remote SSH. The SSH connection itself succeeds, and the Cursor server starts correctly, but the client fails to connect through the forwarded port.

Environment

  • Local OS: Windows 11

  • Remote host: Windows 10

  • Remote SSH extension: anysphere.remote-ssh-1.0.44

  • Connection type: SSH with SOCKS forwarding


What Works

  1. SSH authentication succeeds.

  2. Cursor server installs (or detects existing installation).

  3. Cursor server starts successfully.

  4. The server listens on a remote port (e.g., 51200 / 51209).

Example log:

SSH connection established
Server already installed
Starting server ...
Listening on port: 51209
exitCode==0==
isFatalError==false==


The Problem

After the server starts, Cursor attempts to connect via a local forwarded port (e.g., 127.0.0.1:59552 or 127.0.0.1:61642), but the connection repeatedly fails.

Logs show:

socks forwarding established
socks connection closed

Failed to connect to Cursor server at http://127.0.0.1:59552
fetch failed

Could not re-use existing SOCKS connection
Ensure that your remote host ssh config has 'AllowTcpForwarding yes'

It retries multiple times and eventually re-establishes the entire SSH connection, but the issue repeats.


Observations

  • The remote server clearly starts and listens on a port.

  • SOCKS forwarding appears to establish briefly, then immediately closes.

  • Errors include:

    • fetch failed

    • read ECONNRESET

    • The operation was aborted due to timeout


What I’ve Checked

  • SSH login works manually.

  • The server is confirmed running on the remote side.

  • The issue seems specifically related to port forwarding / SOCKS forwarding.

  • Remote host is Windows (so /etc/ssh/sshd_config does not apply in the usual Linux way).


Questions

  1. Does Remote SSH to Windows require specific SSH server settings to allow TCP forwarding?

  2. Is this a known issue with version 1.0.44 of the remote-ssh extension?

  3. Could Windows firewall or antivirus software be interfering with the SOCKS forwarding?

  4. Is there a recommended way to manually test whether Cursor’s expected forwarded port is reachable?

Any guidance would be greatly appreciated.
Thank you!

Hey, thanks for the detailed report.

The “socks forwarding established → socks connection closed” pattern on a Windows remote host usually comes down to a few things. Let’s narrow it down:

  1. Check AllowTcpForwarding on the remote Windows SSH server

On the remote Windows 10 machine, open C:\ProgramData\ssh\sshd_config and make sure this line is present and not commented out:

AllowTcpForwarding yes

After changing it, restart the sshd service:

Restart-Service sshd

This is the most common reason SOCKS connections close right after they’re established.

  1. Windows Firewall or Antivirus

Yes, Windows Firewall or third-party antivirus can interfere. Try temporarily disabling Windows Firewall on the remote machine to test. If that fixes it, you’ll need to add an exception for the SSH server and the Cursor server port range.

  1. Try downgrading the Remote SSH extension

There have been recent regressions in newer versions of anysphere.remote-ssh. Try going back to version 1.0.39 and see if the behavior changes. In Extensions, click the gear icon on Remote - SSH, then Install Another Version, then pick 1.0.39.

  1. Test with a small or empty folder

A similar issue was caused by opening a very large project folder. Try connecting and opening an empty folder first to rule that out: (Need Help!)Connection to Cursor server failed: Failed to connect to Cursor code server

Also, can you share:

  • Your Cursor version (Help > About Cursor > Copy)
  • The contents of sshd_config on the remote Windows machine

That’ll help pinpoint the issue if the steps above don’t fix it.