Skip to content

SSHFS with VS Code🔗

To make mounting H4H more convenient and allow you to interact with the cluster from your IDE of choice, most extensible IDEs have add-ons which support SSHFS. For VS Code that extension is called SSHFS is in available to install from the extensions panel. Just search for SSHFS and select install.

SSHFS🔗

You can now use the command palette (CTRL/CMD + Shift + P) to configure your Remote-SSH targets.

Type "SSH FS:" in the command palette and select the "SSH FS: Configuration" option. This will open a new tab in your editor where you can add a new configuration.

Fill in the following fields:

  • Host: this should be the IP of the Host you are trying to connect to (see env folder for examples of how to set up environment variables for the H4H cluster)
  • Port: port on the host to connect via (see env folder )
  • Username: your H4H username
  • Password: (set to <prompt>) or Private key (set to path to your SSH private key, e.g., $HOME/.ssh/id_rsa)
  • Root: path to the root directory you want to mount (e.g., /cluster/projects/<GROUP_NAME>) for the Data node or /cluster/home/<USERNAME> for the Login node

Leave everything else default and save the configuration.

  • Open the command palette again with CTRL/CMD + Shift + P
  • Select the "SSH FS: Mount" option and select the name of the drive to mount
  • It will prompt for your password if you didn't configure a Private Key (sometimes it asks more than once, just play along and it should work eventually)
  • You should now see a new folder appear in the file explorer: "SSH FS - <name>", where <name> is the name of the drive from your configuration file
  • You have now mounted an H4H drive to VS Code and can interact with it like a local directory, including using your VS Code extensions, downloading and uploading files, etc.
  • To get the most out of this extension, consider installing the Remote-SSH extension for VS Code, see the dedicated tutorial. This will allow you to run code on the remote machine, debug, and use the terminal as if you were SSH'd into the machine directly.

Similar extensions are available for other common IDEs such as Atom. If you use them, please feel free to add a section with instructions on setup.

References🔗

  1. How to use SSHFS to Mount a Remote File System Over SSH
  2. VS Code SSHFS Extension
  3. Visual Studio Code Installation