How to connect to the Linux farms over SSH in VSCode. Useful in COMP284. VSCode is a waaaaaaayyy better text editor than the recommended gedit, and it also helps you keep all your stuff in one place rather than using several different IDEs / editors.
Note: For Mac users use Cmd
instead of Ctrl
in shortcuts.
Open VSCode and under Extensions (Ctrl-Shift-X)
, search for "ssh" and install "Remote - SSH" and "Remote - SSH Editing...".
Open the VSCode settings search by pressing Ctrl-Shift-P
and type "open ssh". The top option should read "Remote-SSH: Open SSH Configuration File". Press Enter
.
You should now be presented with a couple options, hit Enter
on the one that looks like <your_user_area>.ssh\config.
Now we need to enter our connection settings in the format:
Host <host>
HostName <hostname>
MACs <MAC>
User <username>
Note: the MAC is an encryption algorithm used when logging in. Lots of them will work but I found that a SHA512 one works fine, so I'll be using that.
-
Replace
<hostname>
and<host>
with the address of a UoL Linux server, such aslxfarm01.csc.liv.ac.uk
(you can choose from 01 up to 08 I think, I'm not really sure it matters either). -
Replace
<MAC>
withhmac-sha2-512
(this is the SHA512 algorithm from the note above) -
Replace
<username>
with your university username (do not include the @liverpool.ac.uk part)
In my case, my config file looks like this:
Save the file.
Once we've made the config file, we should be able to connect.
Click the Remote Explorer in the left side of VSCode (blue arrow), then click Refresh (red arrow).
Your connection should now show up. Right-click and choose current or new window to start the connection process, where you will be prompted for your password.
Note: sometimes VSCode will not be able to figure out what system it is connecting to, and it will show a few options. Just click Linux.
Once connected, we will have access to all our files on the Linux systems. In the left-hand side of the screen click Explorer (Ctrl-Shift-E)
and open a folder. It will default to your home directory on the server. Click "OK" in the prompt.
All done! Now you can access your files in the Explorer panel, edit them, create them and so on... If you'd like to access the terminal press Ctrl-Shift-'
or click Terminal > New Terminal in the toolbar.
Thanks for reading this guide and I hope it helped. If you have any questions or something isn't working please create an issue on GitHub and I'll do my best to help.