Linux for CSE 374

This document has some basic information about getting started with Linux. Please let us know about useful changes or additions that we should make as you discover what works, what doesn't, and (even better) what could be improved.

The good news is that there are many, many ways to get access to a usable Linux system. The bad news is that there are many, many ways to get access to a usable Linux system. That means you may run into problems that are due to your individual setup and it may be hard for us to help you diagnose exactly what is going on.

The bottom line is actually pretty simple. You need to be able to open a window that runs bash, the standard Linux shell, and has editors, compilers, and other tools that allow you to create and run shell scripts and C/C++ programs. Many recent Linux distributions will be fine for almost all projects, and there are easy ways to set up your personal machine to run the necessary tools even if your own computer is not a Linux machine.

For our reference system we're using the UW CSE CentOS Linux distribution. Other Linux and Mac OS X systems are very similar, and Windows machines also use the same underlying processors and memory organization. But for projects in this course, the department's CentOS Linux is our reference system and assignments need to work on, and will be graded on, those systems. If you normally run a different 64-bit Linux distribution on your computer you should be able to use that as you work on your assignments, but you need to check your answers on the CSE configuration to be sure there are no subtle differences that cause problems when we evaluate your work.

These notes are a work in progress. Comments, questions, and suggestions on the class discussion board or via email to the staff would be most appreciated.

CSE x86-64 Linux VM

If your hardware supports it, the "home virtual machine" will allow you to run 64-bit Linux on your own computer. See UWCSE's Home VM web pages for details and links to get the current CentOS VM. After you do this, be sure to run the CentOS software update program (sudo yum update in a terminal window) to install any available patches and security updates. This can amount to several hundred MB the first time you do it, so you may want to wait until you have access to a fast network connection.

klaatu.cs.washington.edu

Everyone in the class has an account on this machine, which is basically the same CentOS Linux image as the home VM. Your account name is your UW netid and the password is randomly generated; you will receive an email message from the course staff with this initial password. Even if you run the VM on your own machine for most of your work, you should log in to this machine to verify your account is set up properly.

Remote access to klaatu from other Linux or Mac OS X machines

If you have a command-line (terminal) interface on your system, you can use ssh to log in:

$ ssh your_uwnetid@klaatu.cs.washington.edu

You'll need to enter your password to log on. If this is the first time you've accessed klaatu you'll receive a warning that it is a previously unknown system name. Answer yes or ok or whatever is needed to accept the connection.

We suggest you use the passwd command on klaatu to change your password after you've logged in the first time.

Note that klaatu will not echo your password as you type it, so you won't see any visible indication that it is being typed. This is a security feature so that nobody can look at your screen to discover your password. The system is still reading the characters you type and will process them when you hit return after you've typed the entire password.

You can use the scp command to transfer files between klaatu and your local machine. Usually this is easiest to do by issuing the commands on your local machine to copy files to or from klaatu, rather than trying to run scp on klaatu itself. klaatu has a well-known internet address, while your machine may have a different dynamically allocated address each time you use it, so it is easier to set up the connection starting from your local machine. For example, to transfer a file foo.txt from your home directory on klaatu to the home directory on your mac, open a terminal window on your mac and type in the following command:

$ scp user@klaatu.cs.washington.edu:~/foo.txt .
(Don't forget the . at the end, which says to copy the file into the current directory - or you can replace that with whatever destination filename you wish. You can omit user@ if your userid on your mac is the same as your klaatu userid.)

Remote access to klaatu from Windows

There are many graphical and command-line applications for Windows that can be used for ssh logins and scp file transfers. Feel free to use whatever you want, but we recommend Putty for remote logins and WinSCP for file transfers.

These programs are pretty intuitive to use. Rather than typing a command line, you need to fill in fields in dialog boxes to specify the machine name (klaatu.cs....), your userid, and password. WinSCP has a particularly convenient dual-pane window view that makes it easy to drag files between your local machine and the remote one. Once you log in we suggest using the passwd command on klaatu to change your password. As mentioned in the mac section, for security reasons, klaatu will not display your password as you type it, but it is receiving the characters and will process them when you hit return.