Remotely Accessing Resources
Students are capable of accessing resources from off campus. There are many ways to achieve access and are detailed below by use case.
VPN Installation and Use
The first step to gaining remote access to Computer Science labs involves installing and using a VPN client from the computer you are working from. Below are instructions for using the WWU general campus VPN and CSCI VPN.
Reading code and commands in this document
Whenever you see
${username}
replace it with your WWU username (be sure to remove the ${} notation as well).Whenever you see a
#
replace it with a numeral. The number of#
in a line are the number of digits. For example,cf###-##
would need to becf420-01
or some other name.
Windows Shell Choices
While accessing a terminal is straightforward for Linux and Mac, there are some options for Windows users.
Powershell can be used for SSH.
In Windows 11 the Windows Subsystem for Linux (hereafter WSL) may also be used. Microsoft has written steps already for installing WSL and a linux distribution, and they can be found here.
SSH
Remote access to the Computer Science department leverages SSH in many ways. It is advisable to learn how this tool works in detail. There is further information in the CS Survival Guide and the man
page for SSH is worth reading. There is also an SSH page here, that is part of the CS Survival Guide.
Running remote work
If you would like to run a job on the linux
pool, all one needs to do is open their terminal of choice and connect via ssh to the linux
pool.
ssh -p922 ${username}@linux.cs.wwu.edu
Prolonged jobs and connections may be terminated as needed to ensure the stability of the service for all users.
Accessing a specific linux host
If you need to connect to a specific host in the linux
pool you can reach out to a specific host. They are numbered 01-12.
ssh -p922 ${username}@linux-##.cs.wwu.edu
Working from a lab system
While the linux
pool normally has all of the software that the rest of the labs does, occasionally they will be at a different release. If you need to use tools from the labs for a course, it is highly advisable to connect to a lab system and work from a local session.
Connecting to a system with least use (linux terminal)
When you want to connect to a lab system, it is best to use the labs
system. This tracks the number of users and the amount of use on each lab system and will put requests to connect on a system with the least amount of utilization. In this way we can attempt to ensure the best performance for students.
ssh -p922 ${username}@labs.cs.wwu.edu
Reconnecting to the last system you connected to from least use
Sometimes you may need to reconnect to the last system you were on. Should this be the case, you can specific labs-last
to connect directly to the last system you were connected to via labs
.
ssh -p922 ${username}@labs-last.cs.wwu.edu
Connecting to a specific system
To connect to a specific system, one can proxyjump to a specific system.
ssh -J ${username}@jump.cs.wwu.edu:922 -p 922 ${username}@cf###-##.cs.wwu.edu
Remotely connect to a service
Sometimes a user will need to connect to a specific service. These are specific to the service someone needs. Below are a few examples of how to do this.
Example: CSCI330 MySQL
If you are using a Windows system you will need to get setup to connect detailed prior in the document.
In order to work on ones CSCI330 database one must create a tunnel to the MySQL server. This terminal should remain open while utilizing the workbench or whatever other tool(s) you have chosen. For directions on interacting with the database system, please see the course guide here.
ssh -N -p922 -L3306:mysql.cs.wwu.edu:3306 ${username}@proxy.cs.wwu.edu
Example: Access web browser; Browse from On Campus
Should you need to browse to a website that is only available on campus, one can use an SSH tunnel to forward local traffic on a port. You will need to configure a browser to utilize a SOCKSv5 proxy. Below is an example for doing this in Firefox. Once that is set, if this command is run in a terminal, while the connection is open, Firefox will browse from on campus.
ssh -N -p922 -D#### ${username}@proxy.cs.wwu.edu
Setup Firefox for SOCKS v5 Proxy
In Firefox, go to Preferences > Advanced > Network
and find the Connection settings
.
Then select the radio button for Manual Proxy Configuration.
Enter localhost
in the field for SOCKS Host and in the port field enter the port number (greater than 1023) you entered after -D
.
Select the SOCKS v5 radio button and the Proxy DNS when using SOCKS v5 checkbox. In the textbox for No Proxy for
, enter localhost, 127.0.01
. Select OK or Save.
To test, connect to the SSH tunnel. Then open a new tab in firefox and browse to WhatIsMyIP. You should see an address that starts as 140.160
. If so your browser traffic is coming from a lab system and you should be able to reach resources that require an on campus IP Address.
Example: Connecting to Windows GUI
If you are in a course which requires the use of windows, you will be given access to remote desktop on a specific pool of systems. To connect you will first establish a proxy connection before moving on to utilizing a tool to connect. Below are examples for Remote Desktop Protocol (hereafter RDP) and rdesktop.
For the -L
field, select a port number greater than 1023.
ssh -p 922 -N -L####:cf###-##.cs.wwu.edu:3389 ${username}@proxy.cs.wwu.edu
RDP
Open your Remote Desktop Connection and set the target to localhost:####
. This is the same ####
as you selected for the -L
field.
It will then ask you to sign in. Select the More Choices
option followed by Use a different account
. In username enter wwu\${username}
and the password is your WWU password.
rdesktop
If you are using rdesktop you can connect with a very simple command. There are many options to customize how this window will behave. One may wish to explore the man
page for rdesktop
.
rdesktop -u ${username} -d csci -N localhost:####
Example: X Forwarding
If you have an X server running on your local system (XOrg on
BSD/Linux, XQuartz on macOS, or VcXsrc on Windows) you may want the
option to forward your X traffic from the lab machine to your local
system. Adding the -Y
flag to ssh will do this for you, and
labs.cs.wwu.edu
will automatically pass it on to the lab system that
it puts you on. Alternatively you can update your ~/.ssh/config
labs
entry with the following lines:
Compression yes
ForwardX11 yes
ForwardX11Trusted yes
When it comes to X forwarding, compression can really help speed things up. If you are not doing X forwarding it is not needed, and can often slow things down.
Let’s look at a sample X forwarding session to see if it works:
[strongbad@lappy486 ~]$ ssh -p 922 -Y strongbad@labs.cs.wwu.edu
strongbad@labs.cs.wwu.edu's password:
Warning: Permanently added the ECDSA host key for IP address '[140.160.137.177]:922' to the list of known hosts.
strongbad@cf418-15.cs.wwu.edu's password:
strongbad@cf418-15:~$ xeyes
^C
strongbad@cf418-15:~$
This created a window on my local desktop, but the application was running on the remote lab machine!
SSH config file suggestions based on the above
Now typing all of those commands every time can get a bit tedious. One can set up their ssh config file to save a large amount of information from above which will make one’s commands shorter.
*BSD / Linux / macOS sample config file
Use your favorite text editor to open ~/.ssh/config
.
Enter the below information:
Host linux linux-??
Hostname %h.cs.wwu.edu
User ${username}
Port 922
Compression yes
Host labs labs-last
Hostname %h.cs.wwu.edu
User ${username}
Port 922
Compression yes
Host csproxy
Hostname proxy.cs.wwu.edu
Port 922
User ${username}
RequestTTY no
Host cs_mysql
Hostname proxy.cs.wwu.edu
Port 922
User ${username}
LocalForward 3306 mysql.cs.wwu.edu:3306
Host webcsproxy
Hostname proxy.cs.wwu.edu
Port 922
User ${username}
RequestTTY no
DynamicForward ####
Host csjump
Hostname jump.cs.wwu.edu
Port 922
User ${username}
ForwardX11 yes
ForwardX11Trusted yes
Host cf???-??
HostName %h.cs.wwu.edu
Port 922
User ${username}
ForwardX11 yes
ForwardX11Trusted yes
ProxyJump csjump
Windows 11 sample config file
Use your favorite text editor to open ~/.ssh/config
. If your editor doesn’t run in Powershell or the WSL, that path will be something like C:\Users\${USER}\.ssh\config
. Replace ${USER}
with your local account username.
Enter the below information:
Host linux linux-??
Hostname %h.cs.wwu.edu
User ${username}
Port 922
Compression yes
Host labs labs-last
Hostname %h.cs.wwu.edu
User ${username}
Port 922
Compression yes
Host csproxy
Hostname proxy.cs.wwu.edu
Port 922
User ${username}
RequestTTY no
Host cs_mysql
Hostname proxy.cs.wwu.edu
Port 922
User ${username}
LocalForward 3306 mysql.cs.wwu.edu:3306
Host webcsproxy
Hostname proxy.cs.wwu.edu
Port 922
User ${username}
RequestTTY no
DynamicForward ####
Host csjump
Hostname jump.cs.wwu.edu
Port 922
User ${username}
Host cf???-??
HostName %h.cs.wwu.edu
Port 922
User ${username}
ProxyCommand ssh.exe -q -W %h:%p csjump
Demonstrating the impact of using an SSH Config
Now when using the above commands port numbers of 922
need not be entered. Nor would the fully qualified domain name of ${hostname}.cs.wwu.edu
. Instead the shortened csjump
or cf164-10
can be used. Furthermore ones ${username}
would not need to be set in each instance of a system.
Long-Hand Command |
SSH Config Command |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|