A Win11 PC host is exposed to the public internet via domain forwarding.
I’m trying to access it from my Mac(M3) on the public internet using vscode-remotessh, but failed.
In the vscode logs, I can only see the message “connection closed by remote host.” The log details are in the next section.
When I try to connect via SSH in the terminal on my Mac, it works, and accessing it via vscode-remotessh from a Windows platform also works.
Within the local network, my Mac can connect to the Win11 PC using vscode-remotessh.
Connection situation are summarized as follow:
Source | Target | Loc/Pub | Situ. |
---|---|---|---|
Mac Ter | Win11 | Pub | ✅ |
Mac VSC | Win11 | Pub | ❌ |
Win Ter | Win11 | Pub | ✅ |
Win VSC | Win11 | Pub | ✅ |
Mac VSC | Win11 | Loc | ✅ |
I’m curious whether this is an issue or if my settings are incorrect.
If it’s the latter, please let me know how to adjust them.
Versions are as follow:
- remotessh:v0.111.2024040515和v0.110.1
- vscode:1.88.1 (Universal)
- macOS:14.4.1(M3)
- windows:win11 23H2 (22631.3447)
- OpenSSH:OpenSSH_for_Windows_8.6p1, LibreSSL 3.4.3
Log from vscode are as follow:
[18:40:47.480] Log Level: 2
[18:40:47.488] SSH Resolver called for “ssh-remote+df-public”, attempt 1
[18:40:47.489] “remote.SSH.useLocalServer”: true
[18:40:47.489] “remote.SSH.useExecServer”: true
[18:40:47.489] “remote.SSH.path”: undefined
[18:40:47.490] “remote.SSH.configFile”: undefined
[18:40:47.490] “remote.SSH.useFlock”: true
[18:40:47.490] “remote.SSH.lockfilesInTmp”: false
[18:40:47.490] “remote.SSH.localServerDownload”: auto
[18:40:47.490] “remote.SSH.remoteServerListenOnSocket”: false
[18:40:47.490] “remote.SSH.showLoginTerminal”: false
[18:40:47.490] “remote.SSH.defaultExtensions”: []
[18:40:47.490] “remote.SSH.loglevel”: 2
[18:40:47.490] “remote.SSH.enableDynamicForwarding”: true
[18:40:47.490] “remote.SSH.enableRemoteCommand”: false
[18:40:47.490] “remote.SSH.serverPickPortsFromRange”: {}
[18:40:47.490] “remote.SSH.serverInstallPath”: {}
[18:40:47.491] VS Code version: 1.88.1
[18:40:47.492] Remote-SSH version: [email protected]
[18:40:47.492] darwin arm64
[18:40:47.492] SSH Resolver called for host: df-public
[18:40:47.492] Setting up SSH remote “df-public”
[18:40:47.494] Acquiring local install lock: /var/folders/l5/39fbq9w10bldwpf64nsm8xf40000gn/T/vscode-remote-ssh-a899dd2f-install.lock
[18:40:47.495] Looking for existing server data file at /Users/yuzhiyuan/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-a899dd2f-e170252f762678dec6ca2cc69aba1570769a5d39-0.109.0-es/data.json
[18:40:47.495] Using commit id “e170252f762678dec6ca2cc69aba1570769a5d39” and quality “stable” for server
[18:40:47.497] Install and start server if needed
[18:40:47.499] PATH: /Users/yuzhiyuan/miniconda3/bin:/Users/yuzhiyuan/miniconda3/condabin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
[18:40:47.499] Checking ssh with “ssh -V”
[18:40:47.504] > OpenSSH_9.6p1, LibreSSL 3.3.6[18:40:47.506] askpass server listening on /var/folders/l5/39fbq9w10bldwpf64nsm8xf40000gn/T/vscode-ssh-askpass-47200151ca49a298b839ebf5c0b5d7922e6cf2f5.sock
[18:40:47.506] Spawning local server with {“serverId”:1,”ipcHandlePath”:”/var/folders/l5/39fbq9w10bldwpf64nsm8xf40000gn/T/vscode-ssh-askpass-c1071fa0daeb68e9dfdfe8e5c867dd5d419c55cb.sock”,”sshCommand”:”ssh”,”sshArgs”:[“-v”,”-T”,”-D”,”59625″,”-o”,”ConnectTimeout=15″,”df-public”],”serverDataFolderName”:”.vscode-server”,”dataFilePath”:”/Users/yuzhiyuan/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-a899dd2f-e170252f762678dec6ca2cc69aba1570769a5d39-0.109.0-es/data.json”}
[18:40:47.506] Local server env: {“SSH_AUTH_SOCK”:”/private/tmp/com.apple.launchd.JFEqdFG07m/Listeners”,”SHELL”:”/bin/zsh”,”DISPLAY”:”1″,”ELECTRON_RUN_AS_NODE”:”1″,”SSH_ASKPASS”:”/Users/yuzhiyuan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.109.0/out/local-server/askpass.sh”,”VSCODE_SSH_ASKPASS_NODE”:”/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin)”,”VSCODE_SSH_ASKPASS_EXTRA_ARGS”:””,”VSCODE_SSH_ASKPASS_MAIN”:”/Users/yuzhiyuan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.109.0/out/askpass-main.js”,”VSCODE_SSH_ASKPASS_HANDLE”:”/var/folders/l5/39fbq9w10bldwpf64nsm8xf40000gn/T/vscode-ssh-askpass-47200151ca49a298b839ebf5c0b5d7922e6cf2f5.sock”}
[18:40:47.506] Spawned 8150
[18:40:47.587] > local-server-1> Running ssh connection command: ssh -v -T -D 59625 -o ConnectTimeout=15 df-public
[18:40:47.588] > local-server-1> Spawned ssh, pid=8155
[18:40:47.590] stderr> OpenSSH_9.6p1, LibreSSL 3.3.6
[18:40:48.540] stderr> debug1: Server host key: ssh-ed25519 SHA256:HnQTDCJQBTLEnQOyaHnqaY0wMfJsLVn/qNo6T9c/IP0
[18:40:48.715] stderr> Authenticated to 70p27492c0.zicp.fun ([115.236.153.170]:29358) using “publickey”.
[18:40:50.846] stderr> Connection to 70p27492c0.zicp.fun closed by remote host.
[18:40:50.846] stderr> Transferred: sent 3184, received 2708 bytes, in 2.1 seconds
[18:40:50.846] stderr> Bytes per second: sent 1496.3, received 1272.6
[18:40:50.848] > local-server-1> ssh child died, shutting down
[18:40:50.855] Local server exit: 0
[18:40:50.855] Received install output: local-server-1> Running ssh connection command: ssh -v -T -D 59625 -o ConnectTimeout=15 df-public
local-server-1> Spawned ssh, pid=8155
OpenSSH_9.6p1, LibreSSL 3.3.6
debug1: Server host key: ssh-ed25519 SHA256:HnQTDCJQBTLEnQOyaHnqaY0wMfJsLVn/qNo6T9c/IP0
Authenticated to 70p27492c0.zicp.fun ([115.236.153.170]:29358) using “publickey”.
Connection to 70p27492c0.zicp.fun closed by remote host.
Transferred: sent 3184, received 2708 bytes, in 2.1 seconds
Bytes per second: sent 1496.3, received 1272.6
local-server-1> ssh child died, shutting down[18:40:50.856] Failed to parse remote port from server output
[18:40:50.860] Resolver error: Error:
at g.Create (/Users/yuzhiyuan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.109.0/out/extension.js:2:499734)
at t.handleInstallOutput (/Users/yuzhiyuan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.109.0/out/extension.js:2:497056)
at e (/Users/yuzhiyuan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.109.0/out/extension.js:2:558185)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /Users/yuzhiyuan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.109.0/out/extension.js:2:580094
at async t.withShowDetailsEvent (/Users/yuzhiyuan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.109.0/out/extension.js:2:583753)
at async /Users/yuzhiyuan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.109.0/out/extension.js:2:554890
at async T (/Users/yuzhiyuan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.109.0/out/extension.js:2:552941)
at async t.resolveWithLocalServer (/Users/yuzhiyuan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.109.0/out/extension.js:2:554430)
at async k (/Users/yuzhiyuan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.109.0/out/extension.js:2:577311)
at async t.resolve (/Users/yuzhiyuan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.109.0/out/extension.js:2:581124)
at async /Users/yuzhiyuan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.109.0/out/extension.js:2:847283
[18:40:50.865] ——
Jacky Yu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.