Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify port for VSCode server when using Remote - SSH?

How can I specify on which port will instance of VSCode server be started on remote host? Is it at all possible?

Currently it seems like VSCode just selects this port somewhat randomly. However it won't work for me since in my environment almost all the ports are closed.

There is Default Forwarded Ports setting, but either I don't understand how to fill it in correctly, or it is about different thing.

I believe my question is not a duplicate of this one. I am talking about a different port.

like image 848
gyzerok Avatar asked May 15 '26 10:05

gyzerok


2 Answers

Update:

You can now specify range of ports like so

"remote.SSH.serverPickPortsFromRange": {
  "hostname": "8000-9000"
},

Where "hostname" is the hostname of the remote server.

Original:

Currently VSCode does not support specifying custom port for VSCode server instance.

There is an open issue on the topic: https://github.com/microsoft/vscode-remote-release/issues/1386

like image 149
gyzerok Avatar answered May 17 '26 22:05

gyzerok


Just add remote SSH config on vs code and edit that config like bellow

Host www.somehostName.com
 HostName 194.00.83.57
 User root
 Port 9022

you can also add pvt key files this is the key

IdentityFile ~/.ssh/target

like image 44
Alap Avatar answered May 18 '26 00:05

Alap



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!