Linux System Administration Resource Disk
David Morgan  my email address
U.S.C. - ITP377x - Fall 2007


Grades

Slide presentations

Introduction/Installation

Bootup

Bootloaders

Sys Control Mechanisms

The landscape

ssh - Secure shell

Backup

Webmin - remote admin

Centralized logging

Syslog-ng

Logging: logrotate

Logging: swatch

stunnel - tunnel w/ssl

Scheduled processes

User administration

A user mgmt script

 Init process

The Shell

Compilation

Installation

Patching

yum (auto-update)

Kernel building

Shell Scripting

Permissions

Processes

Homemade shell

ProcessUID control

Unix time

Pluggable Authentication Modules (PAM)

GNUPrivacyGuard (gpg)

Passwords




This CD contains a number of resources we will use, most notably copies of the slide sets for most of the lectures (left column) and prescribed/guided exercises to perform in class (right column). Here is a syllabus. These approximately represent what we want to cover. We may not cover every topic that's here and may cover topics that aren't. 

Grades - have been posted (link "Grades" upper left) including final exam. Thank you for taking the class, I hope you will have future use for what you've learned. (12/19)

Homework - next week's topic is maintaining software on a linux system. How to compile it, install it, auto-download it.
read - chapter 11 "Package management" pp 234-247 but skip the parts about RHN and APT on 240-246.
preview -slides entitled "Compilation," "Installation," and "yum (auto-update)."
preview - exercises entitled "rpm economics" and "yum and rpm." (11/27)

Extra credit - here's the link to the assignment about filesystem analysis I described in class (in particular note the link it contains entitled "Analyzing a filesystem). It was given to another class in the past. Here is the solution in the form of an annotated excel spreadsheet. The class that did this assignment had related questions about the subject on their final exam. Those become your optional, extra credit work for this class. Their exam questions on the subject, plus accompanying supporting handouts for that exam, are here. There are 4 questions to be answered. Please send me the answers by email if you wish to do the extra credit. (11/27)

Homework - cron daemon for scheduled/periodic jobs, ntp network time protocol
- read textbook chapter 8 "Periodic Processes"
- p/review slides "Scheduled processes" and lab exercise "scheduled jobs"
- textbook's scant ntp coverage on p. 902
- "Linux, Clocks, and Time"
- wikipedia article
- time precision howto (11/19)

Homework - due 11/19
Do - assignment at link entitled "apache via stunnel." Refer to the slides at the link entitled "stunnel - tunnel w/ssl," and if needed the references on the last slide, for guidance configuring stunnel. The target server is dmorgan.us. The assignment asks for a printout of the screen. (11/12)

Homework - due 11/12, after the test
read - chapter 10 "Syslog and log files"
do - the tutorial found under the "GNU tar Reference Manual" link. It provides for you to create an archive file named "music.tar". When you have made it, email it to me as homework. (10/29)

Upcoming topics - syslog ("Centralized logging" slides), syslog-ng ("Syslog-ng"), logrotate ("Logging: logrotate"), swatch ("Logging: swatch"), stunnel ("stunnel").

Homework - read the materials about tar and rsync in the sections down below headed "About tar," and "About rsync." (10/29)

Test - here is information about next Monday's test

It consists of 26 questions of which 22 are multiple-choice and 4 are true/false. It will be closed book. The questions are divided among these topic areas:

system startup - 4 questions
system control - 3
user management - 6
processes, and their user ids - 8
file permissions - 2
ssh - 2
backup - 2

Here are some things that show up on the test:
hard and soft links - landscape ppt
"what's available" slide - /proc - system control ppt
operation of permissions - user management ppt
structure of passwd, shadow, group files
structure of the sudo's sudoers configuration file and its priviledge specifications
fork/exec (10/29)

Test - will be November 5. (10/24)

Grades - published at link entitled "Grades" at left. Listed according to last 4 digits of your student ID. (10/22)

Homework -
read - about ssh
textbook pp 697-98, Getting Started with SSH
preview - the instructions for the lab exercise we'll do at the beginning of next class, at the link entitled "ssh key setup"
note - there are good ssh clients for Windows. I like OpenSSH for Windows (command line, same syntax as linux) and PuTTY (graphical, widespread). (10/15)

Homework -
read - textbook Chapter 20, pp 669-684; includes treatment of user/password security issues. Note the graphic below entitled "Process wants to use a file" and make sure you recognize/understand the concept it conveys. (10/8)

Tonight's program - will look at the part of "Permissions" slides that detail the syntax and usage of the chmod command. You will do "users/groups/access" in-classs exercise. We'll cover "Homemade shell" slides, which extend those we saw last week, "Processes." "Processes" and "Homemade shell" have a series of short, important, progressively developed sample programs. Their purposes are summarized in the table below in the  "Demonstration programs for unix process mechanism 'fork/exec'" section. The programs are available to you in both source and compiled forms. They have names like fork1.c, fork2.c, etc. Leading up to fork9.c, which is a tiny but functional command shell. You should be familiar with it because we will utilize it next week in another in-class exercise. This series of programs are available via anonymous ftp from sputnik.smc.edu. The code is shown in the slides. Refer to those and then if you want to actually run the programs, download them to a linux machine and do so. (10/8)

Coming up after tonight - the intersection of what we studied this week: users and processes. That is, control of the user account under which a process executes. Preview the slides entitled "ProcessUID control" and the in-class exercise of the same title, which we'll perform. Briefly visit the website for sudo and read about it. In particular, the "short introduction," "brief history," and the 3 "Manual" links. Get the flavor of it, spend 15 minutes. Beyond that we'll look at ssh (secure shell), backup (tar, rsync), and logging (syslog, logrotate, swatch). We'll do network backup and logging (to another machine) and apply ssh to secure those datastreams. (10/8)

Slides we examined tonight were "User administration" and "Processes." We did the "disabling users" in-class exercise. Next week we'll do the "users/groups/access" exercise and "Homemade shell" slides. See the section below entitled Demonstration programs for unix process mechanism "fork/exec" to obtain the short source files from the "Processes" presentation that we ran in class. Experiment with them. (10/1)

Slides we examined a week ago were "Sys Control Mechanisms," and we did the "system control" in-class exercise. Next, tonight, after the system startup quiz, will be "User administration" slides and "disabling users" in-class exercise, then "Processes" and closely related "Homemade shell" slides. (10/1)

Slides we examined tonight were those at the link "Bootloaders," somewhat cursory treatment, then "The landscape." For next week please preview "Sys Control Mechanisms" and the related lab exercise "system control" (righthand column). I checked the exercise in the classroom after class tonight and it works. (9/17)

Upcoming slides - links entitled "Bootloaders," "The Landscape," "Sys Control Mechanisms." (9/17)

Slides we examined on Monday about the bootup process are the ones at the link entitled "Bootup" at left. (9/13)

Homework
read - good article on system startup
read - the article on the same subject at the link below "Linux System Startup"
read - textbook chapters
 chapter 3 - rootly powers
 chapter 6 - adding new users
 chapter 5 - the filesystem
 chapter 4 - controlling processes
visit - the Linux Documentation Project and become familiar with the resources there
do - on an extra credit basis, the assignment at the link entitled "device vs file" at right. Turn in 2 floppies labeled with your name and either "device" or "file" next week. (9/10)

Office Hours - by prearrangement. If you need to talk to me I can come early or stay late on a given Monday. I'm also on campus Friday. If you want to meet me at one of those times please let me know. (9/10)


About Unix SysV startup procedure
  - Linux System Startup article

About tar:
the GNU tar Reference Manual
read from section 1 "Introduction" - 1.1-1.4
read from section 2 "Tutorial Introduction to tar" - whole section
read from section 3 "Invoking GNU tar" - 3.1-3.4
from section 5 "Performing Backups and Restoring Files" - just scan it

About rsync:
A Tutorial on Using rsync
Snapshot-style backups with rsync - this method is more subtle than it looks, in its use of hard links. The core of it is the 5-line script in the section titled "Putting it all together." Read through that section, paying particular attention to the "review of hard links" and the use of the option (-l) of the cp command to only copy links to files, not their data itself. We will use this method in class.
the rsync algorithm, which makes rsync particularly efficient for dealing with large data volumes sent over low bandwidth channels because it identifies incremental changes within files and sends/applies only those deltas.

About ssh:
Getting Started with SSH

About time and ntp: - read about time and ntp (network time protocol)
- "Linux, Clocks, and Time"
- wikipedia article
- time precision howto

About logging  with syslog, or syslog-ng and stunnel (secure tunnel)
- see the syslog-ng site and admin guide
- a syslog-ng article
Secure tunnel (stunnel)
- read "SSL Encrypting Syslog with Stunnel"

About GPG  (GNU Privacy Guard)
- www.gnupg.org
- this PGP wiki (gpg derives fro pgp)

About PAM  (pluggable authentication modules)
- look at the various resources on PAM's primary distribution site 
   especially click "Online documentation," find the System Administrator's Guide,
   read the "Overview" section

About kernel compilation
- here is the README that comes with the kernel source.
- try http://www.digitalhermit.com/linux/Kernel-Build-HOWTO.html.

Demonstration programs for unix process mechanism "fork/exec" - If you wish to examine or experiment, here is the series of 11 programs used in my slides demonstrating the workings of fork and exec. You can get them by anonymous ftp from sputnik.smc.edu under the same names by which they appear in the slides shown in class: fork1.c, fork2.c,..., fork11.c. (Files are in /pub/molay/ch08/; slides are at links, lower left, entitled "Processes" and "Homemade shell". If you download these source files and want to compile so you can run them, the command to compile would be, for example:

  gcc  fork1.c  -o  fork1

The summary of the point of these programs is:

Version Purpose
fork1 shows fork, demonstrates that 2 processes result
fork2 shows PIDs (process id numbers) of these processes, and that they're distinct
fork3 shows fork's return value to the child copy (zero) and its return value to the parent copy (child's PID)
fork4 shows how to code differentiated behavior via an "if" structure conditioned on fork's return value
fork5 incorporates an exec call in the child
fork6 introduces exit call in child and wait call in parent, to give orderly discipline to their relative timing
fork7 gets the name of the program to be exec'd from the user via the command line
fork8 interactively gets the name of the program to be exec'd by prompting user
fork9 puts the activity inside a loop to extend it to second, third, fourth,... commands
fork10 shows a zombie process
fork11 shows an adopted child, init process as its step-parent after being pre-deceased by its original parent


How access permissions work:

 

My 3 favorite linux books (see the syllabus), respective strengths:
Nemeth - explanatory revelations not found elsewhere, blends explanation with howto stronger on the former
Negus - uniquely blends explanation with howto stronger on the latter
Sobell - comprehensiveness, and particular accessibility. Find what you're looking for quickly in this book, that you spend time searching around for elsewhere. Sometimes uncanny how you can put your finger on what you need.

CD-boot linux, Windows unmolested - http://www.knoppix.org/ and other "live CDs" that are bootable directly to linux (without using or messing with your hard disk), http://www.frozentech.com/content/livecd.php. It's a way for you to easily have access to linux, without having to install it, if you have a PC.


Assignments/labs

 

device vs file

Shellscript 1

Shellscript 2

permissions

system control
 (in-class)

boot sequence
 (in-class)

runlevels
 (in-class)

bootloaders
(in-class)

ssh key setup
 (in-class)

backup
 (in-class)

users/groups/access
 (in-class)

disabling users
(in-class)

centralized logging
 (in-class)

rotating log files
 (in-class)

monitoring log files
 (in-class)

syslog-ng
(in-class)

scheduled jobs
 (in-class)

rpm economics
 (in-class)

yum and rpm
 (in-class)

ProcessUID control
(in-class)

Unix time
(in-class)

PAM
(in-class)

Message digests
(in-class)

GNUPrivacyGuard
(in-class)

stunnel
(in-class)

apache via stunnel
(homework)

BIOS and bootloader passwords
(in-class)

compiling the kernel
(in-class)