=================================== Using the SSH-FS plugin for VS Code =================================== The easiest way to access the CSE servers using VS Code is to use the ‘SSH FS’ plugin. The ‘Remote-SSH’ plugin can fill up your account and slow down the server, so use this one instead. Installing the plugin ===================== Go to the Extensions button: .. image:: sshfs_images/image1.png :width: 400 :alt: Extensions button Type ‘ssh fs’ into the search box: .. image:: sshfs_images/image3.png :width: 400 :alt: Search SSH FS And hit ‘Install’ on the match that comes up. Creating a new configuration ============================ You will now have an SSH-FS tab on the left-hand toolbar. Click it to see a list of SSH configurations on your machine: The list will be empty, so click the create button to make a new one: .. image:: sshfs_images/image2.png :width: 400 :alt: Create a new config Enter a name for the new config – I’ve used ‘cse’ here, but you can call it whatever you like. Then hit ‘save’ to move to the next step. .. image:: sshfs_images/image5.png :width: 400 :alt: Create CSE Now you need to enter the details for your username and login server. Enter your zID in the ‘Username’ box, and enter ~ for the Root. For the Host, enter loginX.cse.unsw.edu.au, whereX is the last digit of your ziD. For example, if your zID is z1234567, use login7.cse.unsw.edu.au .. image:: sshfs_images/image4.png :width: 400 :alt: Configure your connection Scroll down to the bottom of the list, and click ‘Save’ to finish: .. image:: sshfs_images/image7.png :width: 400 :alt: Save Connecting to the server ======================== Your new configuration will now show up in the list: .. image:: sshfs_images/image6.png :width: 400 :alt: New configuration Click the ‘Add as workspace folder’ button: .. image:: sshfs_images/image9.png :width: 400 :alt: New configuration You will be prompted to enter your password – use your zPass for this: .. image:: sshfs_images/image8.png :width: 400 :alt: New configuration Your CSE home directory will now show up in your workspace: .. image:: sshfs_images/image12.png :width: 400 :alt: New configuration Go back to the SSH-FS tab, and click the terminal button: .. image:: sshfs_images/image10.png :width: 400 :alt: New configuration And a terminal will open on the login server, in your home directory: .. image:: sshfs_images/image11.png :width: 400 :alt: New configuration Changing the start directory ============================ If you want your workspace to start in a subfolder – maybe you have a Work directory you keep all your work in – then you can change the Root path in your SSH configuration to match. Go back to the configuration list, and hit the Edit Configuration button: .. image:: sshfs_images/image13.png :width: 400 :alt: New configuration You can then edit the Root path to any directory you want – then scroll down and hit Save. .. image:: sshfs_images/image14.png :width: 400 :alt: New configuration .. note:: You can also create a second connection if you want – for instance, to have a separate workspace in /tmp, to see the temporary files your code creates. Just create a new configuration – maybe called cse-tmp – and put /tmp in the Root box. Now you can open up workspaces or terminals for that connection, and they’ll start in the right folder.