So I've been using the VS Code Remote-SSH extension for around 2 years now, basically daily, and everything was working just fine.
Now in the last couple of weeks, I've not been able to connect to a remote server using VS Code which has a custom port number set (I can connect to it manually over SSH, so it's not the remote machine). I've tried multiple different ways of setting the ssh config, and none of them seem to be working, it still just defaults to port 22, even though I very clearly have a custom port set in my config.
This is the output I get when trying to open the remote server in ssh:
Install terminal quit with output: ssh: connect to host_name port 22: Connection refused
Received install output: ssh: connect to host_name port 22: Connection refused
Failed to parse remote port from server output
My config looks like this:
Host server_name
HostName server_ip_address
User username
Port 1234
I've also tried using different configs like:
# this solved an issue previously where the extension wasn't using the specified username to connect on some test machines
Host username@server_name
HostName server_ip_address
User username
Port 1234
and
# where <server_name> has the IP specified in my local 'hosts' file
Host server_name
HostName server_name
User username
Port 1234
This exact config has been working reliably for the last 9 months or so since I've been managing the remote server, but like I said, it suddenly stopped connecting on the custom port, and I've spent hours trying to find a solution, or at least the problem, and I haven't come across anything that's worked, or even pointed me in the right direction. So any advice or redirection on this will be great.