Open 3f6a opened 3 weeks ago
A few ideas.
ssh
command executed is the same, intending stock MacOS or something else (which ssh
).ssh
with -v
or -vv
or -vvv
to see the diffs between ssh VSCode terminal and external terminalJust my two cents.
@albertosantini
Check if the ssh command executed is the same, intending stock MacOS or something else (which ssh).
It is the same, in both cases /usr/bin/ssh
.
Debug ssh with -v or -vv or -vvv to see the diffs between ssh VSCode terminal and external terminal
The output of ssh -vvv
is exactly the same in both cases.
It cannot be the same debug session: this is very weird.
It would mean ssh correctly works in both context, vscode terminal and external terminal, doesn't it?
The output of ssh -vvv is exactly the same in both cases.
@albertosantini Sorry this was inaccurate. I meant the same up to the point of failure (No route to host
). Here is the output I get from the integrated terminal:
% ssh -vvv REMOTE_HOST
OpenSSH_9.8p1, LibreSSL 3.3.6
debug1: Reading configuration data ~/.ssh/config
debug1: ~/.ssh/config line 77: Applying options for lecuona
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug2: resolve_canonicalize: hostname REMOTE_IP_ADDRESS is address
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '~/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '~/.ssh/known_hosts2'
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug3: channel_clear_timeouts: clearing
debug3: ssh_connect_direct: entering
debug1: Connecting to REMOTE_IP_ADDRESS [REMOTE_IP_ADDRESS] port 22.
debug3: set_sock_tos: set socket 3 IP_TOS 0x48
debug1: connect to address REMOTE_IP_ADDRESS port 22: No route to host
ssh: connect to host REMOTE_IP_ADDRESS port 22: No route to host
For the external terminal, the same command works with the same output up to the last No route to host
messages.
I am afraid VSCode and its terminal is not the culprit.
Hope that helps. No other ideas here.
Actually, same issue happens with a WiFi connection (and no Ethernet connection). This WiFi is one of the ones provided internally in the corporate network.
So it seems to me that something is different in the way ssh
runs within the integrated terminal vs. the external terminal ... what could it be ?
ssh -vvvv ...
Last try and catch the diffs. :)
Like before, no difference, up to the No route to host
failure .... (I thought ssh -vvv
was the max verbosity possible)
The terminal itself cannot be involved.
I have been following the idea, for some reason, the enviroment or the setup is different.
$ env
ifconfig
I know you did it. Check again.Another idea is traceroute
, the network path in wifi and ethernet maybe are different or the company set different "filters".
I recap the tests:
Did I understand correctly?
Did I understand correctly?
There are two WiFi networks. On one of them VScode terminal fails, but on the other it works. In all cases, external terminal always works.
ifconfig
gives exact same outputs for both. I just tried traceroute
and also shows exactly the same output.
env
shows some differences specific to VS code, that as far as I can see are unrelated.
I ran into a strange situation where:
ssh remote_host
fails, when run on the VS code integrated terminal, but the same command succeeds on my system (external) terminal. I tried to bisect what was going on with limited knowledge, and I'll attempt to give more details here.
This issue only happens on a wired connection at work, where the network has some corporate restrictions. If I connect on the WiFi, in the same network, the issue does not happen. I then figured that there must be something different in the way network connections (specifically ethernet) are handled within VS code and its integrated terminal, vs. the external terminal. However, I tried running things like
env
andifconfig
, but I see pretty much identical outputs (up to minor vscode specific differences that I don't think are relevant).Lastly, my personal machine is on macOS, latest version. The remote is a Linux box within the corporate network.
If anyone with more knowledge has any specific questions, or any illuminating suggestions of what differs in terms of networking between the VS code integrated terminal and the external terminal, I'd be happy to provide more details.
ssh remote_host
@3f6a When you switch from "wifi ok" to "wifi ko" do you restart VSCode?
I was having the same issue after updating to MacOS Sequoia. I was unable to use ssh from vscode to any server the same network that I was currently on (with no helpful message other than undefined error 0
), but had no issue if I was on a different network, or using a different terminal application. It turns out MacOS Sequoia added a "Local Network" security setting which limits communication between devices on your local network for individual apps. Switching on vscode in Settings > Privacy > Local Network fixed this issue for me, and explains why ssh worked in the default terminal application, and in vscode while on non-local network. Hope this helps!
Edit: see also #228862
@teddykoker Thanks! Indeed the issue surfaced after I updated to macOS Sequoia. I will try this next time I'm at the corporate network!
I ran into a strange situation where:
fails, when run on the VS code integrated terminal, but the same command succeeds on my system (external) terminal. I tried to bisect what was going on with limited knowledge, and I'll attempt to give more details here.
This issue only happens on a wired connection at work, where the network has some corporate restrictions. If I connect on the WiFi, in the same network, the issue does not happen. I then figured that there must be something different in the way network connections (specifically ethernet) are handled within VS code and its integrated terminal, vs. the external terminal. However, I tried running things like
env
andifconfig
, but I see pretty much identical outputs (up to minor vscode specific differences that I don't think are relevant).Lastly, my personal machine is on macOS, latest version. The remote is a Linux box within the corporate network.
If anyone with more knowledge has any specific questions, or any illuminating suggestions of what differs in terms of networking between the VS code integrated terminal and the external terminal, I'd be happy to provide more details.