Skip to content

SSH Terminal Set Up Guide

Alicia G edited this page Mar 10, 2023 · 1 revision

To implement the SSH Terminal for the Instructor View, follow the steps below:

Steps to set up Server

  1. Connect to SU Global Protect VPN
    • Not necessary if you're on campus wifi
  2. SU server setup
    1. Open SSH session into SU server: ssh <SU server hostname>
      • Use this session to monitor stuff (i.e. creation of submission directories, check for idle SSH sessions)
    2. Open another SSH session into SU server, to setup port forwarding channel: ssh -L 8080:localhost:8080 <SU server hostname>
      • Temporary workaround for now before we get SSL certificates setup for Spring Boot app
    3. In port-forwarded SSH session, navigate to spring-boot-server directory, then run the Spring Boot app: java -jar chromeApiServer-0.0.1-SNAPSHOT.jar
  3. Local setup:
    1. [REQUIRED] In backend/ssh-web-server directory, create a .env file with the following variables:
      • NODE_PORT = 8000
      • EXPRESS_PORT = 7000
      • SSH_PORT = 22
      • SU_HOST, SU_PW, SU_USER: contact support for your email and pw
    2. Navigate to backend/ssh-web-server directory, then:
      1. Install dependencies, if necessary: npm install
      2. Run the node server: npm run start
    3. Navigate to frontend/canvas-chrome-ext directory, then build the extension: npm run build
    4. Open extension settings in Chrome and point extension to dist directory or reload/update extension, if necessary
  4. Open up the speedgrader for an assignment in Canvas
    • Read-only code view and terminal will load
    • Terminal should automatically change to the submission directory
    • When switching to another student or closing browser tab, SSH session created for the terminal view should automatically logout (can verify by running who command in monitoring session or looking at node server logs)

Notes

  • Contact SU support for server credentials
  • SSH sessions that are auto-opened in the extension should be logged out automatically in the code, but double check before logging out that there are no idle sessions
    • who: view current SSH logins (1 minimum or 2 if you still have port-forwarded session open)
    • ps -ef | head -1; ps -ef | grep sshd: view all SSH processes and their process IDs (PID column)
    • kill <pid number>: terminate session by process ID (use number from PID column, not the parent process ID PPID column)
Clone this wiki locally