Lab 1 - Mar 28

For this lab we will learn how to log into Helios and compile the sample programs contained on the book CD from Chapter 1. If you cannot attend the lab, please come to office hours to receive your Helios login.

Login Steps

The desktops should have a shortcut towards the bottom called Helios. If it does not, look for a program called Putty and follow the steps in "Connect from Home" to configure Putty. Double click the shortcut.

You will receive a prompt to enter a username or login, type the username given on your account sheet and hit enter. This will typically echo to the screen.

It will then ask you for a password. Enter the password on the login sheet. This will not be echoed. Passwords are case sensitive so make sure you are using the proper upper/lower case and that caps lock is not on.

If you entered the password correctly, you will now be at the prompt in the shell for your account on Helios. Helios is a type of UNIX operating system that one mainly uses from the command line. CMPS 150 will teach you how to use this command line environment. If you cannot attend CMPS 150, come to office hours or to one of the tutoring times in SCI 409. The schedule is posted in the hallway. Here is the department tutorials as well:

C++ Survival Guide
UNIX Survival Guide
vi Survival Guide

Connect from Home

You will need to download a telnet or SSH client to connect from home. A SSH client is recommended as it will encrypt your password, while telnet clients will send the password in plaintext. You can download the Putty SSH/telnet client from the CS department download page. When you launch Putty, it will present a connection dialog. Enter "helios.cs.csub.edu" for the Host Name and select "SSH" for the Protocol type in the top of the dialog. Optionally, you can save this information by entering a name for the session and clicking save in the bottom of the dialog. Click open to initiate the connection. You will see a dialog box about saving the key for Helios. This is to protect against something called a "man in the middle" attack. The key should be 22:0f:95:05:fa:58:9e:b0:32:4c:42:9d:36:60:c5:5f. Click Yes to connect.

Once you connect, you log in as above.

Editing a File

To edit a file, you type one of the following commands. CS majors should use vi or vim. Other majors can use pico if they find it easier.

vi <filename>
vim <filename>
pico <filename>

You can then either type your program in directly or paste in a program you have in the clipboard, such as if you copied one of the sample programs from the book's CD. To paste in Putty, you must press SHIFT+INSERT at the same time. The CTRL key shortcuts you may be familiar with do not work in Putty. Save your program and exit the editor to return back to the prompt.

To compile and link your program, type the following:

g++ <filename>

To run your program, type the following:

./a.out

If your program stops responding, press CTRL+C at the same time to stop it.