gyzerok
gyzerok

Reputation: 1418

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.

Upvotes: 5

Views: 28862

Answers (2)

gyzerok
gyzerok

Reputation: 1418

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

Upvotes: 6

Alap
Alap

Reputation: 111

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

Upvotes: 5

Related Questions