Visual studio code¶
Visual studio code (VSCode) is a lightweight editor developed by Microsoft, offering advanced code editing capabilities, extensions, and customization options.
In a local desktop at GERAD/CIRRELT¶
In order to use the program in our linux desktops you need to do the following:
In your personnel computer¶
You can download the software at https://code.visualstudio.com/download then follow the instructions.
ssh remote connexion¶
Start vscode then add the module Remote - SSH in teh extensions section.
This will allow you to add a remote configuration to our servers, then open and edit all the files in your local account at CIRRELT/GERAD.
In order to configure ssh in vscode, follow these instructions
- Install the extension"Remote - SSH".
- Open the
View > Command palette
orCtrl + Shift + P
(Windows) ouCmd + Shift + P
(Mac) and look foir the commandRemote-SSH: Add New SSH Host
. - Enter the :
ssh username@servername
Then clickAdd ssh host
. - Connect to the remote server uning the command
Remote-SSH Connect to Host
inView > Command palette
If you want to connect to remote machines using ssh keys, here is some example of ssh config:
- Generate an ssh keys using the
ssh-keygen
in your laptop or home computer. - Copy the public key (by default it's (par défaut,
i_rsa.pub
) in the remote server. - Add the private key to the ssh agent using the command
ssh-add
in your terminal. -
Configure your ssh connexion in VS Code follow the same steps to a standard ssh connexion using the private key in the config parameters.
-
ssh config parameters:
- [HOSTNAME] : Name of the remote host.
- [IP_ADDRESS] : IP address of the remote host.
- [USERNAME] : Login username.
- [PATH_TO_PRIVATE_KEY] : Absolute path to the ssh private key.
For example :
/home/[USERNAME]/.ssh/id_rsa
Yoiu can connect to the renote host by typing in your terminal :
$ ssh [HOSTNAME]
VS Code uses this ssh config tooo to connect to remoste hosts.
```