SSH Connection to Replit

Hey everybody!
im trying to connect Cursor with Replit but the connection wont work. I created an ssh key and put it into the Replit SSH Config. After that i got the shell command in replit:

ssh -i %HOMEPATH%/.ssh/replit -p 22 30b5eb4a-ea4c-401f-9eed-8f551ffc6866@30b5eb4a-ea4c-401f-9eed-8f551ffc6866-00-1yd46okkcugaa.worf.replit.dev

Now i put that into the SSH Host creation in Cursor. After that when i want to connect. i get the following problem:

Can anybody tell me what to do so the connection works? This right here is the error code. Really appreciate the help btw :slight_smile:

[17:36:01.684] Log Level: 2

[17:36:01.693] SSH Resolver called for "ssh-remote+30b5eb4a-ea4c-401f-9eed-8f551ffc6866-00-1yd46okkcugaa.worf.replit.dev", attempt 1

[17:36:01.693] "remote.SSH.useLocalServer": false

[17:36:01.693] "remote.SSH.useExecServer": true

[17:36:01.694] "remote.SSH.showLoginTerminal": false

[17:36:01.694] "remote.SSH.remotePlatform": {}

[17:36:01.694] "remote.SSH.path": undefined

[17:36:01.694] "remote.SSH.configFile": undefined

[17:36:01.694] "remote.SSH.useFlock": true

[17:36:01.694] "remote.SSH.lockfilesInTmp": false

[17:36:01.694] "remote.SSH.localServerDownload": auto

[17:36:01.694] "remote.SSH.remoteServerListenOnSocket": false

[17:36:01.694] "remote.SSH.showLoginTerminal": false

[17:36:01.694] "remote.SSH.defaultExtensions": []

[17:36:01.694] "remote.SSH.loglevel": 2

[17:36:01.695] "remote.SSH.enableDynamicForwarding": true

[17:36:01.695] "remote.SSH.enableRemoteCommand": false

[17:36:01.695] "remote.SSH.serverPickPortsFromRange": {}

[17:36:01.695] "remote.SSH.serverInstallPath": {}

[17:36:01.702] VS Code version: 0.39.6

[17:36:01.702] Remote-SSH version: remote-ssh@0.112.0

[17:36:01.702] win32 x64

[17:36:01.707] SSH Resolver called for host: 30b5eb4a-ea4c-401f-9eed-8f551ffc6866-00-1yd46okkcugaa.worf.replit.dev

[17:36:01.707] Setting up SSH remote "30b5eb4a-ea4c-401f-9eed-8f551ffc6866-00-1yd46okkcugaa.worf.replit.dev"

[17:36:01.711] Using commit id "a4f99b7dfb14460cb0bcebd9f6ac7ca158217920" and quality "stable" for server

[17:36:01.713] Install and start server if needed

[17:36:03.087] Checking ssh with "c:\Users\49171\AppData\Local\Programs\cursor\resources\app\bin\ssh.exe -V"

[17:36:03.089] Got error from ssh: spawn c:\Users\49171\AppData\Local\Programs\cursor\resources\app\bin\ssh.exe ENOENT

[17:36:03.090] Checking ssh with "C:\Program Files (x86)\Razer Chroma SDK\bin\ssh.exe -V"

[17:36:03.091] Got error from ssh: spawn C:\Program Files (x86)\Razer Chroma SDK\bin\ssh.exe ENOENT

[17:36:03.091] Checking ssh with "C:\Program Files\Razer Chroma SDK\bin\ssh.exe -V"

[17:36:03.092] Got error from ssh: spawn C:\Program Files\Razer Chroma SDK\bin\ssh.exe ENOENT

[17:36:03.092] Checking ssh with "C:\Program Files (x86)\Razer\ChromaBroadcast\bin\ssh.exe -V"

[17:36:03.093] Got error from ssh: spawn C:\Program Files (x86)\Razer\ChromaBroadcast\bin\ssh.exe ENOENT

[17:36:03.093] Checking ssh with "C:\Program Files\Razer\ChromaBroadcast\bin\ssh.exe -V"

[17:36:03.094] Got error from ssh: spawn C:\Program Files\Razer\ChromaBroadcast\bin\ssh.exe ENOENT

[17:36:03.094] Checking ssh with "C:\Windows\system32\ssh.exe -V"

[17:36:03.095] Got error from ssh: spawn C:\Windows\system32\ssh.exe ENOENT

[17:36:03.095] Checking ssh with "C:\Windows\ssh.exe -V"

[17:36:03.096] Got error from ssh: spawn C:\Windows\ssh.exe ENOENT

[17:36:03.096] Checking ssh with "C:\Windows\System32\Wbem\ssh.exe -V"

[17:36:03.097] Got error from ssh: spawn C:\Windows\System32\Wbem\ssh.exe ENOENT

[17:36:03.097] Checking ssh with "C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe -V"

[17:36:03.098] Got error from ssh: spawn C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT

[17:36:03.098] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V"

[17:36:03.132] > OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2

[17:36:03.136] Remote command length: 4932/8192 characters

[17:36:03.136] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 65384 "30b5eb4a-ea4c-401f-9eed-8f551ffc6866-00-1yd46okkcugaa.worf.replit.dev" powershell

[17:36:03.138] Terminal shell path: C:\Windows\System32\cmd.exe

[17:36:03.581] > e]0;C:\Windows\System32\cmd.exea

[17:36:03.581] Got some output, clearing connection timeout

[17:36:03.760] > percent_expand: unknown key %H

[17:36:03.782] > Ein Prozess hat versucht, zu einer nicht bestehenden Pipe zu schreiben.

[17:36:05.038] "install" terminal command done

[17:36:05.038] Install terminal quit with output: Ein Prozess hat versucht, zu einer nicht bestehenden Pipe zu schreiben.

[17:36:05.038] Received install output: Ein Prozess hat versucht, zu einer nicht bestehenden Pipe zu schreiben.

[17:36:05.039] Failed to parse remote port from server output

[17:36:05.040] Resolver error: Error:

at g.Create (c:\Users\49171\.cursor\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:499918)

at t.handleInstallOutput (c:\Users\49171\.cursor\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:497240)

at t.tryInstall (c:\Users\49171\.cursor\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:621123)

at async c:\Users\49171\.cursor\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:580768

at async t.withShowDetailsEvent (c:\Users\49171\.cursor\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:584074)

at async k (c:\Users\49171\.cursor\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:577687)

at async t.resolve (c:\Users\49171\.cursor\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:581445)

at async c:\Users\49171\.cursor\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:848061

[17:36:05.044] ------

[17:36:06.093] Opening exec server for ssh-remote+30b5eb4a-ea4c-401f-9eed-8f551ffc6866-00-1yd46okkcugaa.worf.replit.dev

[17:36:06.139] Initizing new exec server for ssh-remote+30b5eb4a-ea4c-401f-9eed-8f551ffc6866-00-1yd46okkcugaa.worf.replit.dev

[17:36:06.141] Using commit id "a4f99b7dfb14460cb0bcebd9f6ac7ca158217920" and quality "stable" for server

[17:36:06.144] Install and start server if needed

[17:41:13.957] getPlatformForHost was canceled

[17:41:13.958] Exec server for ssh-remote+30b5eb4a-ea4c-401f-9eed-8f551ffc6866-00-1yd46okkcugaa.worf.replit.dev failed: Error: Connecting was canceled

[17:41:13.958] Error opening exec server for ssh-remote+30b5eb4a-ea4c-401f-9eed-8f551ffc6866-00-1yd46okkcugaa.worf.replit.dev: Error: Connecting was canceled

What is the purpose of doing this?

To use the features of cursor (like ai generating code) to put that code into replit automatically. I use replit as an easy to deploy online coding environment.

Any updates for a fix on this?

1 Like

Same problem here on Windows 11

Can you share your logs?

This fixed it for me (perhaps formatting, perhaps the last line, not sure):

Host *.replit.dev
    Port 22
    IdentityFile ~/.ssh/replit
    StrictHostKeyChecking accept-new

Link: SSH | Replit Docs

1 Like

How are you able to connect without HostName? which extension did you install on Cursor?
I did the same and Cursor or even VSCode could not even find the configuration

I do get this error by connecting to my Replit:
Resolver error: Error: Remote - SSH is only supported in Microsoft versions of VS Code

1 Like

It still does not work, any updates?

PS C:\Users\andre> ssh -vvv -i C:\Users\a.ssh\new_replit_key -p 22 your_replit_username@74ad5185-de01-4155-80ca-e8c22cf02f2c-00-t6asp9sl5mni.janeway.replit.dev
OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2
debug1: Reading configuration data C:\Users\a/.ssh/config
debug1: C:\Users\andre/.ssh/config line 1: Applying options for *.replit.dev
debug1: Connecting to 74ad5185-de01-4155-80ca-e8c22cf02f2c-00-t6asp9sl5mni.janeway.replit.dev port 22.
debug1: Connection established.
debug1: identity file C:\Users\a\.ssh\new_replit_key type 3
debug3: Failed to open file:C:/Users/a/.ssh/new_replit_key-cert error:2
debug1: Remote protocol version 2.0, remote software version Replit-SSH-Proxy
debug1: Authenticating to 74ad5185-de01-4155-80ca-e8c22cf02f2c-00-t6asp9sl5mni.janeway.replit.dev:22 as ‘your_replit_username’
debug1: Offering public key: C:\Users\a\.ssh\new_replit_key ED25519 SHA256:…
debug3: receive packet: type 51
debug1: Authentications that can continue: password,publickey
debug1: Offering public key: C:\Users\a\.ssh\new_replit_key ED25519 SHA256:…
debug1: Authentications that can continue: password,publickey
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug1: Next authentication method: password

You need to put your username where it says your_replit_username

I got same error.

Yeah it’s not working for me either. Asks for a password. Tried a bunch of work arounds. The issue seems to be that clicking the “Launch Cursor” button in Replit opens cursor by default in the windows environment thus uses the C:/ ssh config file. There’s no real way to launch it into the WSL linux environment.

Using the manual connection route works, but then we can’t open the replit directory inside of cursor as a workspace

A bit silly… but I figured it out. Instead of setting up ssh in WSL, do it in windows regular file system (C:). I had some issue still with the ssh config file (IdentityFile) but just use “~/.ssh/replit”. Then add the public key to replit and copy the shell command to connect manually. Then go back to cursor and “connect with ssh” and add in the shell command and open in linux and it will open in WSL like you’d expect. Then open folder and navigate (in the replit server) to your project and open it.