Network Security
(INFT73-332)
Lab Notes for Week 1: Introduction to Linux

Linux Introduction

All of our lab work is going to be on machines running the Debian distribution of Linux, so these lab notes will introduce you to the Linux environment. We are not going to have time to give an extensive Linux tutorial, so you will need to refer to the subject resources and ask lots of questions.
Your Debian box is actually one of several machines running in the IT School's Linux Lab. All of the machines are on their own subnet with a firewall between them and the rest of Bond's networks. This is done to ensure that any mischief or misconfigurations on the Debian boxes do not adversely affect other parts of Bond's network infrastructure. The firewall (which is called hydra after a mythological beast with many heads) has these jobs: Hydra is set up very restrictively: the only traffic allowed inbound to the Debian boxes is SSH (secure logins), and as far as I know, no traffic is allowed out directly.

Logging Into Your Debian Box

Sit down at one of the machines in the Linux Lab. Move the mouse or hit the space bar to wake up the screen. Enter the username and password that you have been supplied, and click on OK to login on the machine.
At some point you will be asked to choose what type of desktop you want: KDE, LXDE or FVWM. Choose LXDE, and also select the option to keep this as your permanent choice.

The LXDE Desktop

If everything went well, you should now have the following LXDE desktop:
Figs/lxdedesktop.jpg
At the bottom of the desktop there is a menu bar with these buttons and icons on the left and the right:
Figs/lxdeleftbuttons.jpg Figs/lxderightbuttons.jpg
The four buttons on the left are:
  1. The menu button
  2. The file manager button
  3. The web browser button
  4. A button to minimise your windows
Also on the left is an icon which shows you which of the two virtual desktops you are currently using. You can click on the desktops to switch between the two desktops. This is very useful when you have a large number of windows opened up.
The three desktop icons show your Home folder, a folder representing the whole computer, and a Trash folder.
The four icons/buttons on the right are:
  1. A display of the current system load as a graph
  2. The time
  3. A button to lock the display
  4. A button to logout of the machine

The LXDE Menu

Click on the bottom-left icon to reveal the LXDE main menu:
Figs/lxdemainmenu.jpg
It's very much like the Windows Start menu, but with a set of application groups with specific applications in each group. Here are some of the sub-menus:
Figs/lxdeaccmenu.jpg Figs/lxdeinetmenu.jpg Figs/lxdeprefsmenu.jpg
You should become familiar with these applications: Have a quick browse of the available applications in the various menu levels. For now, launch an LXTerminal, and try these commands out:
id          # Show details about you as a user
pwd         # Prints out the current working directory that you are in
ls -l       # Shows a long listing of files in the current directory

Now create a short text document using Kate, and save it in your Home folder. Then double-click on your Home area icon, and find the document you just saved. While you are there, have an explore of the files and folders on your Debian box.

Moving Windows between Desktops

It's a good idea to keep your desktop uncluttered, and one way to do this is to launch only one or two windows per virtual desktop. However, if you find you have too many windows open on one desktop, you can move a window to another virtual desktop.
This is done as follows: right-click on the blue window bar at the top of a window. Follow the pop-up menu and select To Desktop and then the destination desktop for the window. The window will then be moved to that virtual desktop.

Moving Between the Debian and Windows Desktops

Use Alt-Tab to move between the full-screen Debian desktop and your normal Windows desktop. Unfortunately, there is no way to move windows between the two desktops. File transfers can be done, but we will cover that later.

Logging Out from Your Debian Box

Logging out of your Debian box is as easy as clicking on the icon at the bottom-left, and clicking on Log Out. Choose to end the current session.
If you have things running on an LXTerminal, don't forget to terminate them as well before you logout.
Never leave an unprotected session accessible!

The End of Hand Holding

Well, that's about all you are going to get in terms of "hand holding" in this subject. From now on, you will need to actively seek out and absorb the information that you require in order to stay on top of the material. That's what we expect from you when you do a masters level subject.
Your lecturer will be there to give you guidance and support, but the ball is in your court now!

Basic Shell Usage

We will be spending much of our time entering commands at the Linux command-line interface, so below is a quick introduction. But first, some vocabulary: The items in this and the next section are explained very well at the UNIX Introduction and Linux Introduction websites (and others listed in the materials section).
Most Unix programs expect to be called with arguments and many of them allow options for controlling their behaviour,too. This information is usually passed via the command line, i.e. given to the shell command interpreter which in turn passed the information to the program to be executed.
General command invocation syntax:
[path-spec]program_name [options] [arguments]
The path-spec tells the shell where to find the program. Options and arguments are optional. Options come in two major flavours: -X with single letter option names and -some-long-name. The single letter options can often be combined: -abc stands for -a -b -c. The arguments (such as filenames etc.) follow after the options.

Basic Commands and Programs

Your tutor will explain these in more detail.
Command What it does
man Displays manual pages. Try  man man , look at option -s
apropos Looks for manpages that include a keyword
ls List directory contents; use -l to get a detailed list
cd Change to a different working directory; goes HOME if no arguments
mkdir, rmdir Make and remove a directory. Directory has to be empty to remove it
passwd Change your password
mv, cp, rm Move (rename), copy and remove files and directories
cat Output contents of one or more files
less Display contents of a file, one screen at a time
grep Search text files for lines that contain a given pattern
find Find files in a directory that match a given criteria
exit Exit the shell, closing the console window
You will also need to understand absolute filenames (those which begin with a slash /) and relative filenames (those which are named relative to the current directory).
Later, we will cover input/output redirection and pipes in Unix.

Command-line Tasks

Try to accomplish the following small command-line operations:



File translated from TEX by TTH, version 3.85.
On 25 Nov 2011, 11:15.