# How to SSH into HF Space Using Cursor?

**URL:** <https://discuss.huggingface.co/t/how-to-ssh-into-hf-space-using-cursor/172135>\
**Category:** Spaces\
**Created:** [December 31, 2025, 9:59pm UTC](https://discuss.huggingface.co/t/how-to-ssh-into-hf-space-using-cursor/172135 "2025-12-31T21:59:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![perrywinkle](https://avatars.discourse-cdn.com/v4/letter/p/ba9def/32.png) [@perrywinkle](https://discuss.huggingface.co/u/perrywinkle)\
**Post date:** [December 31, 2025, 9:59pm UTC](https://discuss.huggingface.co/t/how-to-ssh-into-hf-space-using-cursor/172135/1 "2025-12-31T21:59:41Z")

</div>

I’m trying to SSH into my HuggingFace Space using the Remote - SSH extension from Anysphere but the process is hanging (dies after 30 seconds). It works on VSCode, but I understand there are some differences between VS Code’s Remote - SSH extension and the one from Anysphere.

What I’ve tried:

- Changing the prefix from “vscode” to “cursor” in the connect link (this step is necessary).

- Increasing the timeout time (up to 5 minutes), still times out.

- Playing around with additional Remote - SSH configurations in the settings.json (taken from VSCode extension settings)

- Confirming the Cursor server is being installed properly and is running on the HF Space

Still, I get this error (log level set to “Trace”):

> _2025-12-31_ _14:50:11.347_ [info] Resolving ssh remote authority ‘\<SPACE\_NAME\>@ssh.hf.space’ (Unparsed ‘ssh-remote+\<SPACE\_NAME\>@ssh.hf.space’) (attempt #1)
> 
> _2025-12-31_ _14:50:11.352_ [info] SSH askpass server listening on /var/folders/ls/lk2x63852z1b7qh25yx5f3h40000gn/T/cursor-ssh-56t9dv/socket.sock
> 
> _2025-12-31_ _14:50:11.352_ [debug] hostname: ssh.hf.space, remote platform map: {“ssh.hf.space”:“linux”,“\<SPACE\_NAME\>@localhost”:“linux”}
> 
> _2025-12-31_ _14:50:11.353_ [info] Using configured platform linux for remote host ssh.hf.space
> 
> _2025-12-31_ _14:50:11.353_ [debug] hostname: ssh.hf.space, remote server install map: {}
> 
> _2025-12-31_ _14:50:11.353_ [debug] hostname: ssh.hf.space, server port range map: {}
> 
> _2025-12-31_ _14:50:11.353_ [info] Using askpass script: /Users/landon/.cursor/extensions/anysphere.remote-ssh-1.0.36/dist/scripts/launchSSHAskpass.sh with javascript file /Users/landon/.cursor/extensions/anysphere.remote-ssh-1.0.36/dist/scripts/sshAskClient.js. Askpass handle: /var/folders/ls/lk2x63852z1b7qh25yx5f3h40000gn/T/cursor-ssh-56t9dv/socket.sock
> 
> _2025-12-31_ _14:50:11.356_ [info] Launching SSH server via shell with command: cat “/var/folders/ls/lk2x63852z1b7qh25yx5f3h40000gn/T/cursor\_remote\_install\_bb27cc31-b979-4aa8-99c8-cd1ced44e4c5.sh” | ssh -T -D 50253 \<SPACE\_NAME\>@ssh.hf.space bash --login -c bash
> 
> _2025-12-31_ _14:50:11.356_ [info] Establishing SSH connection: cat “/var/folders/ls/lk2x63852z1b7qh25yx5f3h40000gn/T/cursor\_remote\_install\_bb27cc31-b979-4aa8-99c8-cd1ced44e4c5.sh” | ssh -T -D 50253 \<SPACE\_NAME\>@ssh.hf.space bash --login -c bash
> 
> _2025-12-31_ _14:50:11.357_ [info] Started installation script. Waiting for it to finish…
> 
> _2025-12-31_ _14:50:11.357_ [info] Waiting for server to install. Timeout: 30000ms
> 
> _2025-12-31_ _14:50:41.360_ [error] Error installing server: Failed to install server within the timeout
> 
> _2025-12-31_ _14:50:41.360_ [info] Deleting local script /var/folders/ls/lk2x63852z1b7qh25yx5f3h40000gn/T/cursor\_remote\_install\_bb27cc31-b979-4aa8-99c8-cd1ced44e4c5.sh
> 
> _2025-12-31_ _14:50:41.362_ [error] Error resolving SSH authority Failed to install server within the timeout

Has anybody ran into this issue and found a solution for it? It seems that at one point in time all you had to do was change the prefix to ‘cursor’ in the connect link, but now updates have made it more complicated.

I’d really like to use my Cursor IDE instead of VS Code if possible!

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [January 1, 2026, 6:30am UTC](https://discuss.huggingface.co/t/how-to-ssh-into-hf-space-using-cursor/172135/2 "2026-01-01T06:30:15Z")

</div>

Hmm…

* * *

Your log points to one narrow failure: Cursor successfully starts SSH, then its **remote bootstrap script never reaches the “ready” state before a 30s watchdog fires**.

That watchdog fires even though `~/.cursor-server` exists, because Cursor is waiting for a very specific handshake from its installer. If the installer gets stuck on **locks** , **dangling processes** , **slow cleanup** , or **stdin/pipe weirdness** , you get exactly:

- `Started installation script. Waiting for it to finish…`
- `Waiting for server to install. Timeout: 30000ms`
- `Failed to install server within the timeout`

This is a common Cursor Remote-SSH failure mode. ([Cursor - Community Forum](https://forum.cursor.com/t/every-time-after-the-upgrade-cursor-remote-ssh-times-out-during-remote-server-installation-despite-a-successful-download-and-extraction/147339 "Every time after the upgrade, Cursor Remote-SSH times out during remote server installation despite a successful download and extraction - Bug Reports - Cursor - Community Forum"))

Below is the fix path I would use for your HF Space case, in the order that tends to actually work.

* * *

## 0) Background: what Cursor is doing on HF Dev Mode

### HF Dev Mode

HF Dev Mode exposes an SSH endpoint to your Space container and recommends using an SSH IDE (VS Code Remote-SSH in their docs). ([Hugging Face](https://huggingface.co/docs/hub/en/spaces-dev-mode "Spaces Dev Mode: Seamless development in Spaces"))

### Cursor’s Remote-SSH install model

Cursor (Anysphere Remote-SSH) installs a **Cursor server** under `~/.cursor-server` on the remote and uses lock files in `/tmp` or `/run/user/...` to coordinate install state. Several Cursor staff posts say these lock issues are a primary cause of 30s install timeouts. ([Cursor - Community Forum](https://forum.cursor.com/t/ssh-connection-error/147007 "SSH connection Error - Bug Reports - Cursor - Community Forum"))

Key detail: Cursor uses a **time-based lock** and writes to the lock file every second from a background bash loop. If that bash process is left behind, future installs look “locked” and then time out. ([Cursor - Community Forum](https://forum.cursor.com/t/failed-to-reconnect-via-ssh-due-to-persistent-failed-to-create-hard-link-error/110324 "Failed to reconnect via SSH due to persistent "failed to create hard link" error - Bug Reports - Cursor - Community Forum"))

* * *

## 1) First thing: force a clean remote state (this is the #1 real fix)

SSH into the Space using your terminal (the direct SSH that works). Then run the cleanup Cursor staff repeatedly recommend:

```bash
# Kill dangling bash subshells that keep the install lock alive
killall bash || true

# Kill the Cursor server if it's still running
pkill -f .cursor-server || true

# Remove the server install + lock files + leftover tarballs
rm -rf ~/.cursor-server /tmp/cursor-remote-lock.* /tmp/cursor-server-*.tar.gz

```

Why this specific set:

- Cursor staff explicitly say old `cursor-server` processes can survive upgrades and block installs. ([Cursor - Community Forum](https://forum.cursor.com/t/every-time-after-the-upgrade-cursor-remote-ssh-times-out-during-remote-server-installation-despite-a-successful-download-and-extraction/147339 "Every time after the upgrade, Cursor Remote-SSH times out during remote server installation despite a successful download and extraction - Bug Reports - Cursor - Community Forum"))
- Cursor staff explicitly say `killall bash` fixes cases where the lock-writer bash loop is left behind. ([Cursor - Community Forum](https://forum.cursor.com/t/failed-to-reconnect-via-ssh-due-to-persistent-failed-to-create-hard-link-error/110324 "Failed to reconnect via SSH due to persistent "failed to create hard link" error - Bug Reports - Cursor - Community Forum"))
- Cursor staff explicitly recommend deleting `~/.cursor-server` and `/tmp/cursor-remote-lock.*` for stuck installs/timeouts. ([Cursor - Community Forum](https://forum.cursor.com/t/ssh-connection-error/147007 "SSH connection Error - Bug Reports - Cursor - Community Forum"))

Then reconnect in Cursor.

If you only do one thing, do this.

* * *

## 2) Make Cursor actually use a longer timeout (your log suggests it is not)

You said you increased timeout, but the log still shows **30000ms**.

Cursor staff commonly recommend increasing:

```json
"remote.SSH.connectTimeout": 120

```

…after clearing locks. ([Cursor - Community Forum](https://forum.cursor.com/t/ssh-connection-error/147007 "SSH connection Error - Bug Reports - Cursor - Community Forum"))

Two practical pitfalls:

### Pitfall A: you edited the wrong settings.json

On macOS, Cursor user settings are typically here:

- `~/Library/Application Support/Cursor/User/settings.json` ([Qiita](https://qiita.com/YumaInaura/items/f4ddc9174c202cdc5f5a "Cursor Editor の 設定ファイルのJSONの場所 ( 直接編集したい )"))

If you have profiles, Cursor tends to follow VS Code’s layout (profile-specific settings live under a `profiles/<id>` directory in the same tree). The VS Code settings doc explains that structure. ([Visual Studio Code](https://code.visualstudio.com/docs/configure/settings "User and workspace settings"))

**What to do**

- Edit Cursor’s actual user settings JSON.
- Fully quit Cursor (Cmd-Q) and reopen.
- Reconnect and confirm the log prints a timeout \> 30000ms.

### Pitfall B: connectTimeout may not control the “install watchdog” in some builds

There are Cursor forum threads where users set `remote.SSH.connectTimeout` and still see “Failed to install server within the timeout”. ([Cursor - Community Forum](https://forum.cursor.com/t/remote-ssh-cursor-server-installation-fails-could-not-acquire-lock-after-multiple-attempts/132078 "Remote-SSH Cursor Server Installation Fails — "Could not acquire lock after multiple attempts" - Bug Reports - Cursor - Community Forum"))

So: treat timeout increases as helpful, but not sufficient. The lock/process cleanup is the main lever.

* * *

## 3) Use “Reinstall Server” inside Cursor if cleanup alone does not stick

Cursor users report that clicking **“Reinstall Server”** reliably restores functionality when the lock/install state is wedged. ([Cursor - Community Forum](https://forum.cursor.com/t/failed-to-reconnect-via-ssh-due-to-persistent-failed-to-create-hard-link-error/110324 "Failed to reconnect via SSH due to persistent "failed to create hard link" error - Bug Reports - Cursor - Community Forum"))

This is basically “Step 1” but done through Cursor UI, and it can also refresh mismatched server binaries.

* * *

## 4) Check for the HF-specific failure mode: piped stdin over SSH produces no output

Your log shows Cursor running a classic Remote-SSH bootstrap style:

- local script piped into SSH
- remote command is a shell that reads stdin

There is an upstream VS Code Remote-SSH issue for HF Dev Mode where:

- normal `ssh user@ssh.hf.space ls` works
- but the _generated piped-script command_ produces **no output**. ([GitHub](https://github.com/microsoft/vscode-remote-release/issues/11296 "Cannot connect to HuggingFace Spaces dev mode. - Stuck at "Got some output, clearing connection timeout" · Issue #11296 · microsoft/vscode-remote-release · GitHub"))

Even though that report is on Windows, it is the same mechanism Cursor uses (script piped to `ssh -T`). If HF’s endpoint or your shell init causes stdin to behave oddly, Cursor will sit waiting for markers and hit 30 seconds.

### Quick test from your local terminal (macOS)

Run this exact pattern:

```bash
printf 'echo __PIPE_OK__ \n' | ssh -T <SPACE_NAME>@ssh.hf.space bash --login -c bash

```

Expected output:

- ` __PIPE_OK__ `

If you get **no output** or it hangs, you have a “piped stdin” problem similar to the HF Dev Mode Remote-SSH issue. ([GitHub](https://github.com/microsoft/vscode-remote-release/issues/11296 "Cannot connect to HuggingFace Spaces dev mode. - Stuck at "Got some output, clearing connection timeout" · Issue #11296 · microsoft/vscode-remote-release · GitHub"))

If you do get ` __PIPE_OK__ `, piping works and your issue is much more likely locks, stale processes, or slow install/cleanup.

* * *

## 5) Reduce shell startup “noise” in non-interactive sessions

Cursor uses `ssh -T` (no TTY) and runs login bash (`bash --login ...`). If your login files print anything or do interactive-only actions, Remote-SSH handshakes can break.

This is not the top suspect for HF Spaces (usually clean), but it is a known real cause of “install script started, never completes.”

What to check on the Space:

- `~/.bashrc`, `~/.profile`, `~/.bash_profile`
- `/etc/profile`, `/etc/motd` (less likely in containers)

If you have custom dotfiles, guard interactive-only logic.

* * *

## 6) Confirm your Space meets HF Dev Mode container expectations (Docker Spaces)

HF says Docker Spaces need:

- `bash` for SSH
- `curl`, `wget`, `procps` for the VS Code server process
- and notes Dev Mode rules for Docker Spaces. ([Hugging Face](https://huggingface.co/docs/hub/en/spaces-dev-mode "Spaces Dev Mode: Seamless development in Spaces"))

If your base image is extremely minimal, Cursor’s server installer can hit unexpected missing-tool paths (VS Code may succeed due to slightly different behavior).

* * *

## 7) Practical “do this now” checklist

In your position, I would do this exact sequence:

1. **Remote cleanup** (most likely fix):  
`killall bash; pkill -f .cursor-server; rm -rf ~/.cursor-server /tmp/cursor-remote-lock.* /tmp/cursor-server-*.tar.gz` ([Cursor - Community Forum](https://forum.cursor.com/t/ssh-connection-error/147007 "SSH connection Error - Bug Reports - Cursor - Community Forum"))

2. In Cursor settings JSON (macOS user settings path), set:  
`"remote.SSH.connectTimeout": 180` ([Cursor - Community Forum](https://forum.cursor.com/t/ssh-connection-error/147007 "SSH connection Error - Bug Reports - Cursor - Community Forum"))

3. Reconnect. If it fails, run “Reinstall Server” in Cursor. ([Cursor - Community Forum](https://forum.cursor.com/t/failed-to-reconnect-via-ssh-due-to-persistent-failed-to-create-hard-link-error/110324 "Failed to reconnect via SSH due to persistent "failed to create hard link" error - Bug Reports - Cursor - Community Forum"))

4. If it still fails, run the ` __PIPE_OK__ ` piped-stdin test. If that fails, you are in the HF Dev Mode “piped script produces no output” class of bug. ([GitHub](https://github.com/microsoft/vscode-remote-release/issues/11296 "Cannot connect to HuggingFace Spaces dev mode. - Stuck at "Got some output, clearing connection timeout" · Issue #11296 · microsoft/vscode-remote-release · GitHub"))

* * *

## High-quality references to keep open while debugging

- Cursor staff fix: locks + broken install cleanup + connectTimeout ([Cursor - Community Forum](https://forum.cursor.com/t/ssh-connection-error/147007 "SSH connection Error - Bug Reports - Cursor - Community Forum"))
- Cursor staff fix: upgrade leaves old cursor-server running, blocks install; pkill + cleanup ([Cursor - Community Forum](https://forum.cursor.com/t/every-time-after-the-upgrade-cursor-remote-ssh-times-out-during-remote-server-installation-despite-a-successful-download-and-extraction/147339 "Every time after the upgrade, Cursor Remote-SSH times out during remote server installation despite a successful download and extraction - Bug Reports - Cursor - Community Forum"))
- Cursor staff explanation of the lock-writer bash loop and why `killall bash` helps ([Cursor - Community Forum](https://forum.cursor.com/t/failed-to-reconnect-via-ssh-due-to-persistent-failed-to-create-hard-link-error/110324 "Failed to reconnect via SSH due to persistent "failed to create hard link" error - Bug Reports - Cursor - Community Forum"))
- HF Dev Mode doc: SSH connection, Docker Space requirements ([Hugging Face](https://huggingface.co/docs/hub/en/spaces-dev-mode "Spaces Dev Mode: Seamless development in Spaces"))
- VS Code Remote-SSH issue on HF Dev Mode: piped-script command produces no output ([GitHub](https://github.com/microsoft/vscode-remote-release/issues/11296 "Cannot connect to HuggingFace Spaces dev mode. - Stuck at "Got some output, clearing connection timeout" · Issue #11296 · microsoft/vscode-remote-release · GitHub"))
- Cursor settings.json location on macOS ([Qiita](https://qiita.com/YumaInaura/items/f4ddc9174c202cdc5f5a "Cursor Editor の 設定ファイルのJSONの場所 ( 直接編集したい )"))

Links:

- [https://forum.cursor.com/t/ssh-connection-error/147007](https://forum.cursor.com/t/ssh-connection-error/147007)
- [https://forum.cursor.com/t/every-time-after-the-upgrade-cursor-remote-ssh-times-out-during-remote-server-installation-despite-a-successful-download-and-extraction/147339](https://forum.cursor.com/t/every-time-after-the-upgrade-cursor-remote-ssh-times-out-during-remote-server-installation-despite-a-successful-download-and-extraction/147339)
- [https://forum.cursor.com/t/failed-to-reconnect-via-ssh-due-to-persistent-failed-to-create-hard-link-error/110324](https://forum.cursor.com/t/failed-to-reconnect-via-ssh-due-to-persistent-failed-to-create-hard-link-error/110324)
- [https://huggingface.co/docs/hub/en/spaces-dev-mode](https://huggingface.co/docs/hub/en/spaces-dev-mode)
- [https://github.com/microsoft/vscode-remote-release/issues/11296](https://github.com/microsoft/vscode-remote-release/issues/11296)
- [https://qiita.com/YumaInaura/items/f4ddc9174c202cdc5f5a](https://qiita.com/YumaInaura/items/f4ddc9174c202cdc5f5a)

* * *

## Summary

- Your failure is “Cursor server install/handshake timed out,” not “SSH auth failed.” ([Cursor - Community Forum](https://forum.cursor.com/t/every-time-after-the-upgrade-cursor-remote-ssh-times-out-during-remote-server-installation-despite-a-successful-download-and-extraction/147339 "Every time after the upgrade, Cursor Remote-SSH times out during remote server installation despite a successful download and extraction - Bug Reports - Cursor - Community Forum"))
- The most effective fix is remote cleanup of **dangling bash + locks + `~/.cursor-server`**. ([Cursor - Community Forum](https://forum.cursor.com/t/failed-to-reconnect-via-ssh-due-to-persistent-failed-to-create-hard-link-error/110324 "Failed to reconnect via SSH due to persistent "failed to create hard link" error - Bug Reports - Cursor - Community Forum"))
- Make sure Cursor is reading your `remote.SSH.connectTimeout` from the real macOS Cursor settings.json. ([Qiita](https://qiita.com/YumaInaura/items/f4ddc9174c202cdc5f5a "Cursor Editor の 設定ファイルのJSONの場所 ( 直接編集したい )"))
- If cleanup does not work, test whether “piped stdin into ssh -T” is broken for your Space, as seen in HF Dev Mode Remote-SSH reports. ([GitHub](https://github.com/microsoft/vscode-remote-release/issues/11296 "Cannot connect to HuggingFace Spaces dev mode. - Stuck at "Got some output, clearing connection timeout" · Issue #11296 · microsoft/vscode-remote-release · GitHub"))

---

<div class="post-metadata">

**Author:** ![perrywinkle](https://avatars.discourse-cdn.com/v4/letter/p/ba9def/32.png) [@perrywinkle](https://discuss.huggingface.co/u/perrywinkle)\
**Post date:** [January 1, 2026, 8:53pm UTC](https://discuss.huggingface.co/t/how-to-ssh-into-hf-space-using-cursor/172135/3 "2026-01-01T20:53:54Z")

</div>

I believe my issue is that the piped stdin over SSH is producing no output.

Things I’ve tried:

1. killing all the Cursor processes
2. removing all the Cursor server files
3. reinstalling the server
4. increasing timeout.

And the following command (ran from my Mac) just hangs:

> printf ‘echo \__PIPE\_OK_\_\n’ | ssh -T \<SPACE\_NAME\>@ssh.hf.space bash --login -c bash

Is this a separate issue that should be opened elsewhere?

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [January 2, 2026, 12:18am UTC](https://discuss.huggingface.co/t/how-to-ssh-into-hf-space-using-cursor/172135/4 "2026-01-02T00:18:48Z")

</div>

Hmm, I see. Dev mode is a relatively new feature and still prone to bugs, so you might want to contact HF. If you can’t get in touch, try emailing: [website@huggingface.co](mailto:website@huggingface.co)

* * *

If `printf 'echo __PIPE_OK__ \n' | ssh -T <SPACE>@ssh.hf.space …` hangs, and the same hang happens with _multiple_ remote programs that should read stdin, then you are outside “Cursor Remote-SSH quirks.” You are in “stdin over non-PTY SSH session is not reaching the remote process, or EOF never arrives.” That is exactly the failure mode reported for HF Spaces Dev Mode in upstream VS Code Remote-SSH too. ([GitHub](https://github.com/microsoft/vscode-remote-release/issues/11296 "Cannot connect to HuggingFace Spaces dev mode. - Stuck at "Got some output, clearing connection timeout" · Issue #11296 · microsoft/vscode-remote-release · GitHub"))

Hugging Face Dev Mode explicitly runs an SSH server in the Space container and expects IDEs to connect via SSH. ([Hugging Face](https://huggingface.co/docs/hub/en/spaces-dev-mode "Spaces Dev Mode: Seamless development in Spaces"))  
Cursor then relies on the same technique VS Code uses: it pipes an installer script into `ssh -T … sh` or similar. When stdin piping breaks, install “hangs then times out.”

* * *

## 1) First isolate what is actually broken: “stdin pipe” vs “login bash”

Your test uses Cursor’s exact remote command pattern: `bash --login -c bash`. That adds a second variable: **login shell startup**. In Cursor’s own forum, staff have identified `.bashrc` / interactive-only commands (like `bind`) as a cause of install hangs and timeouts. ([Cursor - Community Forum](https://forum.cursor.com/t/remote-ssh-connection-fails-with-failed-to-install-server-within-the-timeout/139427 "Remote SSH connection fails with “Failed to install server within the timeout” - Help - Cursor - Community Forum"))

Run this matrix from your Mac. Use **straight quotes** `'` (not curly quotes) to avoid accidental shell nonsense.

### A. Does plain remote exec work (no pipe)?

```bash
ssh -T <SPACE_NAME>@ssh.hf.space 'echo __EXEC_OK__'

```

Expected: prints ` __EXEC_OK__ `.  
If this fails, it is not a stdin issue. It is basic remote exec, auth, or forced-command behavior.

### B. Does stdin piping work with the simplest stdin consumer?

```bash
printf 'HELLO\n' | ssh -T <SPACE_NAME>@ssh.hf.space 'cat'

```

Expected: prints `HELLO` then exits.  
If this hangs, you have the “stdin pipe doesn’t reach remote cat or EOF never arrives” problem.

### C. Does piping work if the remote program is explicitly “read stdin as a script”?

```bash
printf 'echo __PIPE_OK__ \n' | ssh -T <SPACE_NAME>@ssh.hf.space 'sh -s'

```

Expected: prints ` __PIPE_OK__ ` then exits.  
This is the closest analog to how Remote-SSH bootstraps run.

### D. Is it specifically _login bash_ that hangs?

```bash
ssh -T <SPACE_NAME>@ssh.hf.space 'bash --login -lc "echo __BASH_LOGIN_OK__"'

```

Expected: prints ` __BASH_LOGIN_OK__ `.  
If this hangs but A works, your `.profile` / `.bash_profile` / `/etc/profile` path is doing something that blocks in non-interactive mode.

### E. Is it specifically Cursor’s “bash --login -c bash” shape?

```bash
printf 'echo __PIPE_OK__ \n' | ssh -T <SPACE_NAME>@ssh.hf.space 'bash --login -c bash'

```

If **C works** but **E hangs** , then stdin is fine and the _nested bash/login init path_ is your culprit.

* * *

## 2) Interpret results and apply the right fix

### Case 1: A works, but B and C hang

This is the “stdin pipe over `ssh -T` is broken” class.

That is a known HF Dev Mode Remote-SSH problem in the VS Code tracker: normal SSH commands work, but `type script | ssh -T … sh` produces no output, and even `echo "AAA" | ssh -T … "cat /dev/stdin"` fails. ([GitHub](https://github.com/microsoft/vscode-remote-release/issues/11296 "Cannot connect to HuggingFace Spaces dev mode. - Stuck at "Got some output, clearing connection timeout" · Issue #11296 · microsoft/vscode-remote-release · GitHub"))

**What to try next (to confirm it’s PTY-related):**

```bash
printf 'echo __PIPE_OK__ \n' | ssh -tt <SPACE_NAME>@ssh.hf.space 'sh -s'

```

- If `-tt` works but `-T` fails, then the HF endpoint or its wrapper likely only behaves correctly when a PTY is allocated.
- Cursor Remote-SSH uses `-T` for its bootstrap, so Cursor cannot work reliably until HF fixes non-PTY stdin, or Cursor adds an option to allow PTY allocation.

**Where to report**

- This is best reported as a **Hugging Face Spaces Dev Mode SSH endpoint bug** , because you reproduced it with plain `ssh` outside Cursor.
- Also comment on the existing VS Code Remote-SSH issue for HF Dev Mode, because it documents the same failure signature and gives maintainers a cross-reference. ([GitHub](https://github.com/microsoft/vscode-remote-release/issues/11296 "Cannot connect to HuggingFace Spaces dev mode. - Stuck at "Got some output, clearing connection timeout" · Issue #11296 · microsoft/vscode-remote-release · GitHub"))

### Case 2: C works, but E hangs (and/or D hangs)

This is not “stdin piping is broken.” It is “login bash startup is blocking” or “nested bash is not exiting.”

Cursor staff have already diagnosed similar “install hangs at 30s” cases as `.bashrc` / interactive config emitting warnings or doing interactive-only work during non-interactive sessions. ([Cursor - Community Forum](https://forum.cursor.com/t/remote-ssh-connection-fails-with-failed-to-install-server-within-the-timeout/139427 "Remote SSH connection fails with “Failed to install server within the timeout” - Help - Cursor - Community Forum"))

**Fix on the Space**  
Edit the shell init files used by non-interactive login:

- `~/.bashrc`
- `~/.bash_profile` or `~/.profile`
- possibly `/etc/profile` (less likely in HF containers)

Add an early return for non-interactive shells in `~/.bashrc`:

```bash
# If not interactive, do nothing
case $- in
  *i*) ;;
  *) return ;;
esac

```

Then remove or guard anything like:

- `bind …`
- `stty …`
- `read …`
- prompt tooling that assumes a TTY

This aligns with the Cursor forum diagnosis that `bind` warnings can break non-interactive installs. ([Cursor - Community Forum](https://forum.cursor.com/t/remote-ssh-connection-fails-with-failed-to-install-server-within-the-timeout/139427 "Remote SSH connection fails with “Failed to install server within the timeout” - Help - Cursor - Community Forum"))

### Case 3: Only fails when `-D <port>` is present

Cursor uses dynamic forwarding (`-D`) during bootstrap. If your “pipe works” tests omitted `-D`, add a control:

```bash
printf 'echo __PIPE_OK__ \n' | ssh -T -D 50253 <SPACE_NAME>@ssh.hf.space 'sh -s'

```

If adding `-D` changes behavior, report that explicitly. It is high-signal.

* * *

## 3) “Should I open an issue elsewhere?” Yes, if you can show a minimal reproduction

If **plain OpenSSH** reproduces “piped stdin hangs” against `ssh.hf.space`, that is not a Cursor-only issue.

### Best place(s) to file

1. **Hugging Face Forums (Spaces / Dev Mode)**  
HF staff actively monitor these threads for infra issues, and Dev Mode is an HF feature. Your repro is specific to `ssh.hf.space` which is HF infrastructure. ([Hugging Face](https://huggingface.co/docs/hub/en/spaces-dev-mode "Spaces Dev Mode: Seamless development in Spaces"))

2. **Comment on VS Code Remote-SSH issue #11296**  
It already documents the same exact HF Dev Mode “piped script produces no output” behavior and includes a stdin pipe test (`echo "AAA" | ssh -T … cat /dev/stdin`). Add that you can reproduce it on macOS too, and include your command outputs. ([GitHub](https://github.com/microsoft/vscode-remote-release/issues/11296 "Cannot connect to HuggingFace Spaces dev mode. - Stuck at "Got some output, clearing connection timeout" · Issue #11296 · microsoft/vscode-remote-release · GitHub"))

3. **Cursor issue only if the root cause is “Cursor uses bash --login -c bash”**  
If your matrix shows `sh -s` works but Cursor’s `bash --login -c bash` fails, that is a Cursor choice and may deserve a Cursor bug: “use `sh -s` like VS Code” or “avoid nested login bash” or “option to allocate PTY.”

* * *

## 4) What to include in a high-quality bug report (this is what maintainers need)

Include a paste of:

- Your Space type (Docker vs Gradio vs Static) and whether Dev Mode is enabled (and whether persistent storage is enabled)

- Your local `ssh -V`

- Output of the matrix tests A–E (exact commands and whether they print or hang)

- If possible, one `ssh -vvv` log for a failing command and one for a working command:

- Whether `-tt` changes anything

- Whether adding `-D` changes anything

That combination cleanly distinguishes:

- “stdin channel is broken”
- “non-PTY sessions behave differently”
- “login bash init scripts block”
- “dynamic forwarding triggers a policy/bug”

* * *

## 5) Practical workaround if you need Cursor today

If the endpoint truly cannot handle non-PTY stdin, Cursor Remote-SSH will remain unreliable because its bootstrap depends on stdin piping.

Workarounds:

- Use VS Code Remote-SSH (it may have different knobs or a different bootstrap path).
- Use SSHFS to mount the Space filesystem locally and open it in Cursor (editing locally, running remotely).

* * *

## Summary

- Reproduce with a command matrix to separate “stdin pipe broken” from “login bash blocks.” ([Cursor - Community Forum](https://forum.cursor.com/t/remote-ssh-connection-fails-with-failed-to-install-server-within-the-timeout/139427 "Remote SSH connection fails with “Failed to install server within the timeout” - Help - Cursor - Community Forum"))
- If `echo | ssh -T … cat` hangs, it matches the HF Dev Mode Remote-SSH stdin/pipe bug reported upstream. ([GitHub](https://github.com/microsoft/vscode-remote-release/issues/11296 "Cannot connect to HuggingFace Spaces dev mode. - Stuck at "Got some output, clearing connection timeout" · Issue #11296 · microsoft/vscode-remote-release · GitHub"))
- Report to Hugging Face (Spaces Dev Mode) and comment on the existing VS Code issue. ([Hugging Face](https://huggingface.co/docs/hub/en/spaces-dev-mode "Spaces Dev Mode: Seamless development in Spaces"))
- If only `bash --login -c bash` hangs while `sh -s` works, fix dotfiles or file a Cursor-specific issue about their remote command choice.

---

<div class="post-metadata">

**Author:** ![tarunthethor](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@tarunthethor](https://discuss.huggingface.co/u/tarunthethor)\
**Post date:** [January 13, 2026, 9:35am UTC](https://discuss.huggingface.co/t/how-to-ssh-into-hf-space-using-cursor/172135/5 "2026-01-13T09:35:38Z")

</div>

Hi I am Tarun from the Cursor team!

The issue is now fixed!  
You should now be able to access your spaces right inside our IDE.  
Huge shoutout to [Adrien](https://x.com/XciD_) from the HuggingFace team for fixing it on such a short notice!  
Thanks for reporting @perrywinkle and @John6666 for helping it out!

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [January 13, 2026, 12:21pm UTC](https://discuss.huggingface.co/t/how-to-ssh-into-hf-space-using-cursor/172135/6 "2026-01-13T12:21:27Z")

</div>

Thank you, tarunthethor!
