forked from Canvas-Code-Capstone/Canvas-Code
-
Notifications
You must be signed in to change notification settings - Fork 0
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:
- Connect to SU Global Protect VPN
- Not necessary if you're on campus wifi
- SU server setup
- 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)
- 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
- 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
- Open SSH session into SU server:
- Local setup:
- [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
- Navigate to backend/ssh-web-server directory, then:
- Install dependencies, if necessary:
npm install
- Run the node server:
npm run start
- Install dependencies, if necessary:
- Navigate to
frontend/canvas-chrome-ext
directory, then build the extension:npm run build
- Open extension settings in Chrome and point extension to
dist
directory or reload/update extension, if necessary
- [REQUIRED] In
- 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)
- 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)
-