9

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.

1
  • 1
    I'm afraid this is internal to the Remote SSH extension and does not provide any parameter in the SSH Config to define either the Host receiving port nor the Remote Agent port Tunneled remote port 40510 to local port 63464. The rationale might be to permit popular ports such as 5000,3000,8080 be used for mock-up rather than reserve it for vscode-remoteserver tunnel. Commented May 19, 2020 at 22:51

2 Answers 2

8

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

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, that helped me a lot! The serverPickPortsFromRange goes to VS Code settings.json config file.
7

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

2 Comments

You misunderstood the question. I am not asking how to configure ssh port here.
thansk, this works for me

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.