Home > Software engineering >  How to edit code in VS code on private server
How to edit code in VS code on private server

Time:12-01

I want to edit code on server over VS code ssh. With public access server it works fine. I just connect to IP over ssh with my key by VS Code ssh extension. But now I want to edit code on private server that can be accessed over public one.

Over terminal connection process look like:

> ssh -i key [email protected] 
connected to public server
> ssh -i key [email protected] 
connected to private server

So how I can achieve that? This two servers hosted on EC2 Amazon.

CodePudding user response:

You can use SSH's feature Open SSH Configuration File

Insert both hosts and add the ProxyJump directive to your private server:

Host PublicServer
  HostName 10.445.322.12
  User user

Host PrivateServer
  HostName 172.43.65.11
  User user
  ProxyJump PublicServer

Afterwards you should be able to connect to PrivateServer directly from VS Code.

  • Related