Reputation: 859
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.
Upvotes: 1
Views: 74
Reputation: 4019
You can use SSH's feature ProxyJump to achieve this.
Press Ctrl+Shift+P and run command Remote-SSH: 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.
Upvotes: 1