by Sophie Engle on Jul 2013
If you need to test code on the lab computers, you can login to the lab computers remotely and test your code using SSH (Secure Shell). This guide shows you how to SSH into the lab computers.
Before you get started, make sure you know your CS account username and password.
If you are already familiar with SSH, the basic steps to login remotely are:
Use SSH to log into our gateway stargate.cs.usfca.edu
using your CS account username and password.
Run rusers -a
on the command-line to see which lab machines are available.
Use SSH to log into one of the lab machines from the gateway using your CS account username and password.
The following sections detail how to SSH using either Windows or Mac. Either way, make sure you look at the SSH into Lab Computers section near the bottom for what you need to do once you have logged in for the first time.
See SSH on Mac OSX if you are using Mac OSX instead of Windows.
If you are using Windows, you should first download and install PuTTY at http://www.chiark.greenend.org.uk/~sgtatham/putty/. Once installed, open up PuTTy. Enter stargate.cs.usfca.edu
as the Host Name:
Click the "Open" button. You may receive a warning (see below).
Go ahead and click "Accept". When prompted, enter your username and password. You will not see the text you type when entering your password. (This prevents someone from looking over your shoulder and seeing your password.)
Once you have successfully logged in, you will see a welcome message similar to the following:
Read the message! You should not start working on this machine. Skip to the section SSH into Lab Computers below for how to log into one of the lab computers.
You should not need to install anything special to start using SSH. Open up a Terminal window and enter the following command (replacing test
with your username):
ssh test@stargate.cs.usfca.edu
For example, my username is sjengle
so my Terminal window looks as follows:
When prompted, enter your username and password. You will not see the text you type when entering your password. (This prevents someone from looking over your shoulder and seeing your password.)
Once you have successfully logged in, you will see a welcome message similar to the following:
Read the message! You should not start working on this machine. Read on to the section SSH into Lab Computers below for how to log into one of the lab computers.
For security reasons, our lab computers are not directly accessible from the Internet. This may be a tad confusing, but what you have done so far is login remotely to our gateway server named stargate.cs.usfca.edu
. THIS IS NOT A LAB COMPUTER. Please do not use it to work on your homework and projects.
What you must do next is login to a lab computer from our gateway server. You should be at the part where you see a welcome message, no matter whether you are using Windows or Mac OSX. The following screenshots are using Mac OSX, but the text displayed will be similar on Windows and PuTTY.
Next, you need to choose which lab machine to SSH into next. You do not want to choose a machine that another student is already using, since it may be slow. To see which machines are up and have no remote users, run rusers -a
as instructed in the welcome message. You will see something similar to this:
Computer names will always be hrnAAABB
where AAA
is the room (235 or 530) and BB
is the machine number. In the image above, hrn23501
and hrn23502
have no users, and hrn23503
does not show up indicating it is offline. There is one user test logged into hrn23505
and two users test
and sjengle
are logged into hrn53002
.
Choose a machine with no remote users logged in and ssh into that machine. For example, we can run the command ssh hrn23501
to ssh into that machine:
Enter your password when prompted. At this point, you are ready to start working on the lab computers remotely.