In this article I will go through how to connect remotely in VSCode using SSH remote extension.
In both local and server: check that you have open SSH installed by searching Manage Optional Features in the Windows start menu.
In both local and server: open
services.mscand make sure that the services of ssh are running.
its default port is 22.
From Local cmd: To go to the server run
You’ll be asked to enter the server password.
In Local cmd: Now I am in a cmd seeing the Server
In Remote in
ssh-keygenand name the file of the ssh e.g.
In Local: Create a config file (with no extension) in
Host <AnyName> HostName <IP> User <USERNAME> IdentityFile ~/.ssh/<name of the ssh file on the server made in previous step (e.g. ~/.ssh/testSSH)>
In Local: Make Sure to install Remote extension by Microsoft.
Click on its icon (1)
Remote-SSH: Connect to Host
Either do one of the following
(3) Enter e.g.:
A new instance of VSCode will be open.
You’ll be asked for the Operating System, the Server Password.
You can open terminal in VSCode but firstly make sure that the server has Git downloaded.
You are now in the Server terminal:
Now you can download plugins and extensions as
Live Serveron the server from your opened VSCode window.
In Local VSCode: File → Open Folder → type your project path on the server.
You can run Live Server extension and it will show that it is running on a port e.g. 5501 so now you can browse to http://:5501/ to see live dev.
Thanks for your time, and I am happy to get feedbacks.