Skip to content

Accessing the lab machines

Quick Start

The following steps describe how to connect to CS3210/CS3211's lab machines. You will use these machines for labs and assignments.

  1. Your initial credentials for the CS3210/CS3211 Machines are based on your NUSNET ID and a password we sent to you via Canvas. Just remember this for now.

    • Your username is your NUSNET ID (exxxxxxx)
    • Your initial password can be found in a Canvas assignment called "PDC Lab Password" as a comment.
  2. You now need to connect to the NUS School of Computing VPN. If you installed FortiClient before AY 24/25 Semester 2, there are changes: you have to reconfigure it for it to work!

    Warning

    SoC VPN is not the same as the NUS VPN (which is "PulseSecure" or "nVPN"). Please don't use those.

    1. Please follow the instructions at follow at https://dochub.comp.nus.edu.sg/cf/guides/network/vpn/start. Log into this page using your NUSNET ID (starting with e) and password (not your Lab UNIX ID and password).

    2. By following these instructions, you should ultimately install the Forticlient VPN.

  3. Before connecting to a lab machine, you will first need an SSH client on your machine

    1. If you are using Windows, you can use PuTTY or (Windows Subsystem for Linux 2 (WSL)) https://learn.microsoft.com/en-us/windows/wsl/install.

      Warning

      We noticed that some WSL users can’t connect to the lab reliably while using the SoC VPN. We suggest a few alternatives in this case:

      • Use Powershell - follow these instructions
      • Use VSCode / your editor’s built in remote editing tools, see this section for more details
      • If these don’t work, look at the end of this guide for an alternative connection method using the SoC Jump Host here.
    2. If you are using macOS or Linux, you can use the built-in ssh command on the terminal.

  4. Now, choose one of the lab machines below to connect to. These are the available options:

    soctf-pdc-001.d1.comp.nus.edu.sg
    soctf-pdc-002.d1.comp.nus.edu.sg
    soctf-pdc-003.d1.comp.nus.edu.sg
    soctf-pdc-009.d1.comp.nus.edu.sg
    soctf-pdc-021.d1.comp.nus.edu.sg
    soctf-pdc-025.d1.comp.nus.edu.sg
    soctf-pdc-026.d1.comp.nus.edu.sg
    soctf-pdc-027.d1.comp.nus.edu.sg
    soctf-pdc-028.d1.comp.nus.edu.sg
    soctf-pdc-029.d1.comp.nus.edu.sg
    soctf-pdc-030.d1.comp.nus.edu.sg
    soctf-pdc-033.d1.comp.nus.edu.sg
    soctf-pdc-034.d1.comp.nus.edu.sg
    soctf-pdc-036.d1.comp.nus.edu.sg
    

    1. If you are using ssh (if using WSL/Mac/Linux), enter the following command: ssh <lab username>@<hostname>, where <hostname> is one of the hostnames above.

      Example

      ssh sriram@soctf-pdc-002.d1.comp.nus.edu.sg
      
    2. If you are using PuTTY, enter the hostname into the "Host Name" field, and click "Open".

  5. You will be prompted for a password. Enter the password that you got on Canvas.

    Note

    You will not see the password as you type it. This is normal. Just type it in and press enter.

  6. You will be asked to reset your password.

    1. You should see it ask for "Current Password": enter the password from Canvas.
    2. Then, it will ask for "New Password": enter a new password of your choice.
    3. Then, it will ask for "Confirm Password": enter the same password again.

    Note

    You will not see the password as you type it. This is normal. Just type it in and press enter.

  7. You should now be connected to the lab machine. You can now run commands on the lab machine and use it for your labs and assignments.

    Example

    sriram@soctf-pdc-002:~$ ls
    

Improving your "Quality of Life"

Using SSH keys

If you don't want to enter your password every time you connect to the lab machines, you can use SSH keys.

  1. Generate an SSH key on your local machine.
    1. If you are using Windows, you can use PuTTYgen to generate an SSH key.
      1. Please copy the public key that was generated.
    2. If you are using WSL, macOS or Linux, you can use the ssh-keygen command to generate an SSH key.
      1. Find the public key (the file ending with .pub) that was generated. It will likely be in ~/.ssh/id_rsa.pub or ~/.ssh/id_ed25519.pub.
  2. Depending on the machine you want to connect to without a password: your public key needs to be copied to that machine's ~/.ssh/authorized_keys file.
    1. If you're using Mac/Linux: you can use ssh-copy-id user@host to copy the key to that host
    2. If you're on Windows and not using WSL, you may have to use scp to copy it manually, or ask your TA.

Using VSCode

You can use VSCode to edit files on the lab machines without having to use the terminal. We find that many students prefer this workflow.

  1. Install VSCode on your local machine: https://code.visualstudio.com/download
  2. Install the Remote Development extension pack: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack
  3. Follow the instructions here: https://code.visualstudio.com/docs/remote/ssh#_connect-to-a-remote-host. Our server type is Linux.
  4. You should now be able to edit files on the lab machines using VSCode. You can also open a terminal in VSCode to run commands on the lab machines directly.

Alternatives to using SoC's VPN

While the SoC VPN is the easiest way to connect to the lab machines (by far), it may not work for some, for certain reasons:

  • Forticlient isn’t supported on your OS
    • Note that it’s shown to be working on Ubuntu, Arch Linux, etc, so your OS has to be reasonably obscure for it not to work
  • You find that the VPN is not stable enough over time
    • Sometimes putting the computer to sleep will kill the VPN connection
      • However - you should be running scripts in the background as much as possible to avoid issues with this
  • As mentioned earlier - issues with Windows and WSL

In these cases, you can use the SoC Jump Host - please follow SoC’s official instructions here: https://dochub.comp.nus.edu.sg/cf/guides/sjump/start.

Note

This workflow will require you to enter your password each time, but you can automate this by using the sshpass tool.

Just a reminder that this section is not necessary unless you find the original workflow problematic in some way.