Using VS Code to connect to servers using SSH

Remote Development using SSH 

 

Image may contain: Rectangle, Triangle, Font, Material property, Electric blue.

The Visual Studio Code Remote - SSH extension allows you to open a remote folder on any remote machine, virtual machine, or container with a running SSH server and take full advantage of VS Code's feature set. Once connected to a server, you can interact with files and folders anywhere on the remote filesystem.

No source code needs to be on your local machine to gain these benefits since the extension runs commands and other extensions directly on the remote machine.

Image may contain: Font, Rectangle, Parallel, Electric blue, Slope.

This lets VS Code provide a local-quality development experience - including full IntelliSense (completions), code navigation, and debugging - regardless of where your code is hosted.
(From here: https://code.visualstudio.com/docs/remote/ssh)


So, here is a guide to connect to mimi.uio.no:

  1. On your client: Install Visual Studio Code.
  2. Install the Remote-SSH extension.
  3. In VS Code, select Remote-SSH: Connect to Host... from the Command Palette (F1, Ctrl+Shift+P) and use user@mimi.uio.no (Make sure you have ssh keys set up)Image may contain: Sky, Font, Rectangle, Electric blue, Multimedia.

  4. After you are connected, you'll be in an empty window. You can always refer to the Status bar to see which host you are connected to.
  5. You can then open any folder or workspace on the remote machine using File > Open... or File > Open Folder... just as you would locally!
  6. Using the SHH Remote Explorer allows you to keep your favorite servers listed. 

See how you can work with your Jupyter Notebooks using VS Code Remote SSH here.

Tags: jupyter, notebook, lab, code, vscode, ssh By Kjetil Bakke
Published Aug. 2, 2023 1:45 PM - Last modified Aug. 3, 2023 11:53 AM