Skip to content

Latest commit

 

History

History
43 lines (33 loc) · 1.24 KB

File metadata and controls

43 lines (33 loc) · 1.24 KB

Sandbox SSH setup

Cursor Sandbox never mounts your real ~/.ssh, ~/.gnupg, ~/.netrc, ~/.gitconfig, or ~/.config/git. Create a sandbox-only SSH home:

STATE="${CURSOR_SANDBOX_STATE:-$HOME/.cursor-sandbox}"
mkdir -p "$STATE/home/.ssh"
chmod 700 "$STATE/home/.ssh"

Copy or generate keys into that directory only, then add a config. The launcher leaves an existing sandbox config file in place; it only sets GIT_SSH_COMMAND when the file is present.

Host github.com
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_ed25519_github
  UserKnownHostsFile ~/.ssh/known_hosts
  IdentitiesOnly yes

Paths in that config are interpreted with the sandbox $HOME (~/.cursor-sandbox/home), so ~/.ssh/... refers to the sandbox SSH directory. Absolute paths under the sandbox home also work.

Seed known hosts before the first connection (optional):

export CURSOR_SANDBOX_SSH_HOSTS="github.com"
ssh-keyscan -H github.com >> "$STATE/home/.ssh/known_hosts"
chmod 600 "$STATE/home/.ssh/known_hosts"

When ~/.cursor-sandbox/home/.ssh/config exists, the launcher exports:

GIT_SSH_COMMAND="/usr/bin/ssh -F $HOME/.ssh/config -o IdentitiesOnly=yes"

(with $HOME already pointing at the sandbox home).