0

I am trying to use the "Remote SSH" feature on a server that I have to connect to via a non-standard port. However, it is not working - the console output shows the following:

[09:09:17.304] SSH Resolver called for host: foobar.example.com
[09:09:17.304] Setting up SSH remote "foobar.example.com"
[09:09:17.309] Using commit id "da15b6fd3ef856477bf6f4fb29ba1b7af717770d" and quality "stable" for server
[09:09:17.311] Install and start server if needed
[09:09:18.648] Checking ssh with "ssh -V"
[09:09:18.692] > OpenSSH_9.0p1, OpenSSL 1.1.1o  3 May 2022

[09:09:18.696] Running script with connection command: ssh -T -D 49294 "foobar.example.com" bash
[09:09:18.697] Terminal shell path: C:\Windows\System32\cmd.exe
[09:09:35.703] Resolver error: Error: Connecting with SSH timed out
…
[09:09:39.987] > ssh: connect to host foobar.example.com port 22: Connection timed

Now, what I am curious is the line

Running script with connection command: ssh -T -D 49294 "foobar.example.com" bash

What exactly is VSCode doing here? Do I need to open up port 49294 in the firewall?

Also further down in the log is this line:

ssh: connect to host serv69163251-dev01.secure-node.at port 22: Connection timed

But that will never work, because the port is supposed to be different. This is my config for this host:

Host Foobar
  HostName foobar.example.com
  Port 12345
  User foobar
  IdentityFile ~/.ssh/id_foobar
fritzmg
  • 2,494
  • 3
  • 21
  • 51

1 Answers1

1

I met the same problem. My specific ssh port wasn't used even if it was precised in the config file (Users > YOUR_USER > .ssh > config). Here is my config:

 Host root@mydomain.com
  HostName mydomain.com
  Port 2299
  User root
  IdentityFile ~/.ssh/my_key_id_rsa

I renamed the "Host" section to "mydomain.com" in the config file, saved it, it loaded the right config port and ssh connection worked.

Pozinux
  • 964
  • 2
  • 10
  • 22