========================================================================= Summary OUTLINE: ========================================================================= based on text: Linux: The Complete Reference, Sixth edition by Richard Petersen McGraw-Hill/Osborne copyright 2008 (830 pages) ISBN:9780071492478 --------------------------------------------------------------------------------------- Session 1: Intro to Linux - basic concepts and commands - prepare and install --------------------------------------------------------------------------------------- Introduction Part I - Introduction Ch. 1 - Introduction to Linux Ch. 2 - Getting Started Part II - The Linux Shell and File Structure LAB: Using the Class Image - INSTALL (if possible, add KDE, XCFE and Xwindows desktops in addition to GNOME) Lab: install and configure Linux for use via local image. once image is installed and add user accounts for you and your classmates, examine each of the commands listed below through the following exercise: Exercise: Add user accounts once image is working; create accounts for classmates and a backup-root user you will need these additional accounts for class exercises involving networking, scripting, and file sharing later in this course. LAB EXERCISE (outside of class): create text files at the command line in a TERMINAL or CONSOLE window (BASH shell) of the commands discussed in class and place in the "Public" directory. e.g. man fdisk | col -b > ~/Public/fdisk-man.txt Basic Commands (5 essential commands to remember: man ls pwd cd more ) some commonly used commands (each one will be briefly described as to purpose and options): filesystems: fdisk u/mount mkfs df du cat find vi touch file cp rm mv mkdir ln (-s) regular expression: grep awk cut sort sed system/admin/network: su/do ps date echo kill chmod chown chgrp ping script LAB OPTIONAL: download Fedora, or obtain install media and install on a system at home or on an approved work computer. --------------------------------------------------------------------------------------- Session 2 - the shell - user and global configurations - a wealth of history --------------------------------------------------------------------------------------- Ch. 3 - The Shell Ch. 5 - Shell Configuration Ch. 6 - Linux Files, Directories, and Archives Part III - Desktop Ch. 28 - Managing Users LAB: Shell configuration - customize .bashrc and /etc/bashrc focus: shell configuration of prompt, history, variables, aliases and files place a copy of your .bashrc file named in your "Public" directory. --------------------------------------------------------------------------------------- Session 3 - the user experience - files, applications and desktops --------------------------------------------------------------------------------------- Ch. 29 - File Systems: File Permissions (chown, chmod, etc.) Ch. 7 - The X Window System, Xorg, and Display Managers Ch. 8 - GNOME Ch. 9 - KDE Part IV - Linux Software Ch. 10 - Software Management Ch. 11 - Office and Database Applications Ch. 12 - Graphics Tools and Multimedia LAB: Set up and customize desktops in KDE, GNOME, XCFE, Xwindows: (if image only has GNOME, focus on GNOME and Xwindows) - find configuration files for each of the major shells and put them in a file in your "Public" directory. - find the commands to initiate configuration of graphics - identify the dot files and global system files - list common variables used. - create desktop items - create menu items - add selected menu and desktop items to display in all user configurations - note directories and permissions required. PURPOSE: importance of understanding the underlying files and variables as these will impact applications and users. As a System Administrator understanding these configuration files will permit you to enhance your users experience and productivity and "push" these environments out to your users. Knowing what variables to tweak will save you time and allow for rapid configuration of new applications. When installing applications your users will need to have access to the icons or menu selections. --------------------------------------------------------------------------------------- Session 4 - client configurations for network access --------------------------------------------------------------------------------------- Ch. 14 - Web, FTP, and Java Clients Ch. 16 - Encryption, Integrity Checks, and Signatures Ch. 19 - Secure Shell and Kerberos LAB: add your classmates as sudo to /etc/sudoers LAB: configure ssh files under /etc - created .ssh directory and generate keys and trusted hosts GOAL: secure passwordless access to all classroom systems via secure commands for scripting and access. verify access via ssh command to all systems. --------------------------------------------------------------------------------------- Session 5 - combining commands and writing shell scripts --------------------------------------------------------------------------------------- Ch. 4 - The Shell Scripts and Programming Ch. 27 - Basic System Administration Table 27-2: cron Command, Tools, Files and Directories LAB: Shell script - create a script using ssh to record system information for other systems in class to be identified in class. Final product would be mailed. LAB: configure cron to run script at 8am, noon and 6pm on Tues and Thursday --------------------------------------------------------------------------------------- Session 6 - accessing other systems using SSH, wget, rsync and ftp --------------------------------------------------------------------------------------- Ch. 15 - Network Tools Part V - Security Table 15-3: Remote Access Commands ssh, scp, wget, rsync and FTP Ch. 33 - Backup Management Part VIII - Network Administration Services LAB: write a shell script that uses wget to get the daily version of Dilbert, place image in your public directory with the following file name format: yyyy-mmm-dd-dilbert.jpg LAB: Create a backup directory of Public on your local system and provide an hourly backup of those files, only if changed - use tar, rsync and your choice of backup tools. --------------------------------------------------------------------------------------- Session 7 - systems adminstration - putting power tools to work --------------------------------------------------------------------------------------- Ch. 23 - Web Servers Ch. 27 - Basic System Administration Ch. 30 - RAID and LVM Ch. 31 - Devices and Modules Ch. 32 - Kernel Administration Ch. 33 - Backup Management Part VIII - Network Administration Services SUDO and other issues of root LAB: configure Apache on your system. Create a web page that displays Dilbert in chronological order separated by ruler lines at 50% width using a background image of your choice with active links to the Dilbert page where each image was taken from. LAB: use a backup tool or method of your choice to create a daily backup of critical files of your choice and put the image in that directory, take note of disk usage. This directory was created in a lab in Session 6. LAB: create a backup file that may be copied off of the image using a portable format such as tar so that your configuration files can be accessed after class. Write to a thumb drive if possible. --------------------------------------------------------------------------------------- Session 8 - systems administration - managing servers, clients and networks --------------------------------------------------------------------------------------- Ch. 13 - Mail and News Clients Ch. 21 - Managing Services Ch. 22 - FTP Servers Ch. 25 - Mail Servers SERVERS: FTP, Mail, and web LAB: write a script that uses ssh or ftp to move a selected backup image from your backup directory to one other system that you have access to via ssh and place a copy there and restore one file to your local directory only on that remote system. Place it in your "Public" directory. Use your local web browser to view the restored file on your account on the remote system. (hint: http://ip-of-remote-system/~your-user-name/filename ) --------------------------------------------------------------------------------------- Session 9 - systems administration - network --------------------------------------------------------------------------------------- Ch. 15 - Network Tools Part V - Security Ch. 34 - Administering TCP/IP Networks Ch. 35 - Network Autoconfiguration with IPv6, DHCPv6, and DHCP LAB: document your network configuration using a shell script. use network tools to identify other systems on your network (your network may prevent the use of discovery tools, talk to your mentor about your configuration). Run traceroute on three different host names internally or externally, as permitted on your network. LAB: identify the files associated with DHCP and list the fully resolved path of these files. --------------------------------------------------------------------------------------- Session 10 - systems administration - sharing and managing --------------------------------------------------------------------------------------- Ch. 26 - Print, News, Search, and Database Servers Part VII - System Administration Network services: NFS, NIS, Samba LAB: Configure NFS between systems in class. Provide a summary of configuration details of files and settings, place in "Public" directory. LAB: Configure SAMBA and access from a Windows PC. - examine file permissions. Provide a summary of configuration details and place in "Public" directory. --------------------------------------------------------------------------------------- Session 11 - systems adminstration - security --------------------------------------------------------------------------------------- Ch. 17 - Security-Enhanced Linux Ch. 18 - IPsec and Virtual Private Networks Ch. 20 - Firewalls Part VI - Internet and Network Services Ch. 24 - Proxy Servers LAB: create a shell script to attempt failed logins and access to other class systems, create a shell script to examine log files on your system (hint use: uniq -d and sort) and create a local report that could be mailed, set up via crontab. --------------------------------------------------------------------------------------- Session 12 - systems adminstration - managing and updating --------------------------------------------------------------------------------------- Ch. 37 - Distributed Network File Systems Where to Obtain Linux Distributions discuss patching, updating and other general Linux systems administration topics. LAB: gather up configuration information files and scripts created in this class and mail, copy, or write them to a stable location for future use. ------------------------------------------------------------------------------------------------ ========================================================================= DETAILED OUTLINE: (and some teaching notes) ========================================================================= NOTE: chapters should be REVIEWED (skimmed), if possible, prior to class in order to provide a baseline for discussion and to have questions ready. Advanced discussions are welcome to provide a broader context and offer learning opportunities. An hour and a half will go quickly. Not all the material in each chapter will be discussed or relevant to the topic. We will need to refer back to these chapters in future lessons. An important acronym to remember is "YMMV" - your mileage may vary, a humorous way of pointing out that each situation and style is unique and "driver" variations will determine the best way of solving a problem. For every task in Linux there will likely be several ways of completing it. Understanding the underlying requirements for configuration files and processes allows flexibility and proficiency as a user, power user or Systems Administrator. Participation in class in the form of alternate commands and methods is encouraged, but only if it does not confuse lesser experienced students. There may be reasons why a particular command or approach is not recommended, we will discuss those as a way of understanding the Linux environment. Your mentors will have suggestions and recommendations, and specific knowledge of your environment. We will try not make things more complicated than required, as Einstein was attributed as saying: 'Make things as simple as possible, but not simpler.' --------------------------------------------------------------------------------------- Session 1: Intro to Linux - basic concepts and commands - prepare and install --------------------------------------------------------------------------------------- Introduction Part I - Introduction Ch. 1 - Introduction to Linux Ch. 2 - Getting Started Part II - The Linux Shell and File Structure LAB: Using the Class Image - INSTALL (if possible, add KDE, XCFE and Xwindows desktops in addition to GNOME) Lab: installing and configuring Linux for use once the image is installed and user accounts for you and your classmates are created, examine each of the commands listed below through the following exercise: Lab EXERCISE outside of class: create text files at the command line in a TERMINAL or CONSOLE window (BASH shell). recommend these commands to make a plain text file: man | col -b > -man.txt (substitute a command, like fdisk, for , so it would read: man fdisk | col -b > fdisk-man.txt being careful not to introduce special characters at the command line, or spaces in file names.) we will use these files to practice using the vi Editor, regular expressions and search tools. Place these files in your "Public" directory. Advanced students: create a basic script to do this at one time using the vi Editor. Place a copy of this script in your "Public" directory. Really advanced students: create a shell script that loops through the commands in the directories where they reside, or extracting only those listed below using a "here document", or any way you can make it work. Be prepared to share your technique with classmates. Place the script in your "Public" directory. Discussion details: ----------------------- Brief review of Linux history, purpose, use... and future. Before putting hands on a system, a brief discussion of commands (you won't remember, don't worry): Basic Commands (5 essential commands to remember: man ls pwd cd more ) some commonly used commands (each one will be briefly described as to purpose and options): filesystems: fdisk u/mount mkfs df du cat find vi touch file cp rm mv mkdir ln (-s) regular expression: grep awk cut sort sed system/admin/network: su/do ps date echo kill chmod chown chgrp ping script Preparation for install, discussion/review of issues associated with the build process as normally encountered: (your class image will likely have all this decided, discussion will focus on options when installing from downloaded image or from install media) filesystems strategies / lvm / fdisk / dual boot strategies / GRUB issues networking setup/files (see: Table 34-6: TCP/IP Configuration Addresses and Files), using DHCP ?, Wireless ? (often you'll need to know the basics of your network to make it work.) Desktop/graphics - KDE/GNOME/XCFE/Xwindows and Apps - which ones do you want/need? (graphics are often an issue) Install image per local instructions. OPTIONAL: download Fedora, or obtain install media and install on a system at home or on an approved work computer. Add user accounts once image is working; create accounts for classmates and a backup-root user you will need these additional accounts for class exercises involving networking, scripting, and file sharing later in this course. --------------------------------------------------------------------------------------- Session 2 - the shell - user and global configurations - a wealth of history --------------------------------------------------------------------------------------- Ch. 3 - The Shell Ch. 5 - Shell Configuration Ch. 6 - Linux Files, Directories, and Archives Part III - Desktop Ch. 28 - Managing Users  Lab: Shell configuration - dial in .bashrc and /etc/bashrc Shell configuration, history, variables and files (focus on BASH) we will focus on two files for this session: .bashrc and /etc/bashrc we will discuss the configuration of .bashrc for both root users and regular users we will setup HISTORY files and discuss the use of regular expressions to parse that information for future reference and troubleshooting. We will also introduce the concept of "script" to record keyboard activity and show how "col -b" can be used to clean out non-printable characters and then edit that file into a script to repeat the process. example ".bashrc" file: ########################################################## export PS1=" ------------------------------------------------ $(whoami)@`hostname` [\$PWD] ------------------------------------------------ --> " # # QUESTION: why are some variables capitialized? export PROMPT_COMMAND='echo -ne "\033]0;__`hostname` --- `date +%a--%d.%b.%y` ---> ${PWD}\007"' # # QUESTION: PATH variable - would this be acceptable for a root user? why? PATH=$PATH:/usr/bin:/sbin/:/usr/sbin:/etc:/bin:/usr/local/bin:~/:~/bin:/etc/:. export PATH # umask 022 # # QUESTION: why does the ".History" file have a period in front of it? HISTFILE="/home/john/.History/`/bin/date '+%d%b%y'.history`" ; export HISTFILE HISTSIZE=1024; export HISTSIZE # EDITOR=/bin/vi; export EDITOR VISUAL=/bin/vi; export VISUAL # # QUESTION: what does the set command do in this case? set -o vi ################################## # NOTE: aliases are a useful way of reducing keystrokes, why are the commands fully resolved? # NOTE: aliasing commonly mistyped commands is helpful, why? alias dfh="/bin/df -h | grep sda" alias dff="df -h | grep -v udev" alias l="/bin/ls -al" alias ll="/bin/ls -l" alias lm="/bin/ls -l | more" alias mv="/bin/mv -i" alias cp="/bin/cp -i" alias rm="rm -i" alias mroe=more # QUESTION: why would I alias "More"? - hint the pipe symbol requires what additional key? alias More=more # QUESTION: why would I alias a sudo command? What's sudo? alias ss="sudo /etc/init.d/sendmail status" alias lsize="/bin/ls -lSr" # ############################################################################### --------------------------------------------------------------------------------------- Session 3 - the user experience - files, applications and desktops --------------------------------------------------------------------------------------- Ch. 29 - File Systems: File Permissions (chown, chmod, etc.) Ch. 7 - The X Window System, Xorg, and Display Managers Ch. 8 - GNOME Ch. 9 - KDE Part IV - Linux Software Ch. 10 - Software Management Ch. 11 - Office and Database Applications Ch. 12 - Graphics Tools and Multimedia LAB: Set up and customize desktops in KDE, GNOME, XCFE, Xwindows: (if image only has GNOME, focus on GNOME and Xwindows) - find configuration files for each of the major shells and put them in a table. - find the commands to initiate configuration of graphics - identify the dot files and global system files - list common variables used. - create desktop items - create menu items - add selected menu and desktop items to display in all user configurations - note directories and permissions required. PURPOSE: importance of understanding the underlying files and variables as these will impact applications and use. As a System Administrator understanding these configuration files will permit you to enhance your users experience and productivity and "push" these environments out to your users. Knowing what variables to tweak will save you time and allow for rapid configuration of new applications. When installing applications your users will need to have access to the icons or menu selections. --------------------------------------------------------------------------------------- Session 4 - client configurations for network access --------------------------------------------------------------------------------------- Ch. 14 - Web, FTP, and Java Clients Ch. 16 - Encryption, Integrity Checks, and Signatures Ch. 19 - Secure Shell and Kerberos LAB: add your classmates as sudo to /etc/sudoers LAB: configure ssh files under /etc - created .ssh directory and generate keys and trusted hosts --------------------------------------------------------------------------------------- Session 5 - combining commands and writing shell scripts --------------------------------------------------------------------------------------- Ch. 4 - The Shell Scripts and Programming Ch. 27 - Basic System Administration Table 27-2: cron Command, Tools, Files and Directories LAB: Shell script - create a script using ssh to record system information for other systems in class to be identified in class. Final product would be mailed. LAB: configure cron to run script at 8am, noon and 6pm on Tues and Thursday --------------------------------------------------------------------------------------- Session 6 - accessing other systems using SSH, wget, rsync and ftp --------------------------------------------------------------------------------------- Ch. 15 - Network Tools Part V - Security Table 15-3: Remote Access Commands SSH, scp, wget, rsync and FTP LAB: write a shell script that uses wget to get the daily version of Dilbert, place image in your public directory with the following file name format: yyyy-mmm-dd-dilbert.jpg --------------------------------------------------------------------------------------- Session 7 - systems adminstration - putting power tools to work --------------------------------------------------------------------------------------- Ch. 23 - Web Servers Ch. 27 - Basic System Administration Ch. 30 - RAID and LVM Ch. 31 - Devices and Modules Ch. 32 - Kernel Administration Ch. 33 - Backup Management Part VIII - Network Administration Services SUDO and other issues of root LAB: configure Apache on your system. Create a web page that displays Dilbert in chronological order separated by ruler lines at 50% width using a background image of your choice with active links to the Dilbert page where each image was taken from. LAB: create a directory on your system to place backup files - use a backup tool or method of your choice to create a daily backup of any critical files of your choice and put the image in that directory, take note of disk usage. LVM discussion: example process: fdisk -l pvcreate /dev/sd?5 pvdisplay vgcreate vg199 /dev/sd[c-k]5 vgdisplay lvcreate -L 303400 vg199 lvdisplay mkfs -t ext3 /dev/mapper/vg199-lvol0 vi /etc/fstab - add: /dev/vg199/lvol0 /VG199 ext3 defaults 0 0 mkdir /VG199 mount -a df -h --------------------------------------------------------------------------------------- Session 8 - systems administration - managing servers, clients and networks --------------------------------------------------------------------------------------- Ch. 13 - Mail and News Clients Ch. 21 - Managing Services Ch. 22 - FTP Servers Ch. 25 - Mail Servers SERVERS: FTP, Mail, and web LAB: write a script that uses ssh or ftp to move a selected backup image from your backup directory to one other system that you have access to via ssh and place a copy there and restore a file to your local directory only. --------------------------------------------------------------------------------------- Session 9 - systems administration - network --------------------------------------------------------------------------------------- Ch. 15 - Network Tools Part V - Security Ch. 34 - Administering TCP/IP Networks Ch. 35 - Network Autoconfiguration with IPv6, DHCPv6, and DHCP LAB: document your network configuration using a shell script. use network tools to identify other systems on your network. run traceroute on three different host names internally or externally. --------------------------------------------------------------------------------------- Session 10 - systems administration - sharing and managing --------------------------------------------------------------------------------------- Ch. 26 - Print, News, Search, and Database Servers Part VII - System Administration Network services: NFS, NIS, Samba LAB: Configure NFS between systems in class. LAB: Configure SAMBA and access from a Windows PC. - examine file permissions. --------------------------------------------------------------------------------------- Session 11 - systems adminstration - security --------------------------------------------------------------------------------------- Ch. 17 - Security-Enhanced Linux Ch. 18 - IPsec and Virtual Private Networks Ch. 20 - Firewalls Part VI - Internet and Network Services Ch. 24 - Proxy Servers LAB: create a shell script to attempt failed logins and access to other class systems, create a shell script to examine log files on your system (hint use: uniq -d and sort) and create a local report that could be mailed, set up via crontab. --------------------------------------------------------------------------------------- Session 12 - systems adminstration - managing and updating --------------------------------------------------------------------------------------- Ch. 37 - Distributed Network File Systems Where to Obtain Linux Distributions discuss patching, updating and other general Linux systems administration topics. ========================================================================= ORIGINAL OUTLINE: ========================================================================= Session 1  Chapter 1: Introduction to Linux  Chapter 2: Getting Started  Chapter 3: The Shell  : Using the class image  Lab: Installing and Using Linux Session 2  Chapter 4: The Shell Scripts and Programming  Chapter 5: Shell Configuration  Chapter 6: Linux Files, Directories, and Archives  Chapter 29: File Systems  Lab: Shell Programming Session 3  Chapter 27: Basic System Administration  Chapter 28: Managing Users  Lab: Managing Users and Groups Session 4  Chapter 10: Software Management  Chapter 16: Encryption, Integrity Checks, and Signatures  Chapter 17: Security-Enhanced Linux  Lab: Software Manipulation and SELinux Session 5  Chapter 15: Network Tools  Chapter 19: Secure Shell and Kerberos  Chapter 20: Firewalls  Chapter 18: IPsec and Virtual Private Networks  Chapter 21: Managing Services  Lab: Securing Linux Session 6  Chapter 22: FTP Servers  Chapter 23: Web Servers  Lab: Administering Apache Session 7  Chapter 24: Proxy Servers  Chapter 25: Mail Servers  Chapter 26: Database Servers  Lab: MySQL Session 8  Chapter 31: Devices and Modules  Chapter 32: Kernel Administration  Chapter 33: Backup Management  Lab: Backup Management Session 9  Chapter 34: Administering TCP/IP Networks  Chapter 30: RAID and LVM  Chapter 36: NFS and NIS  Lab: RAID Session 10  : Troubleshooting Applications  : Troubleshooting Network and Services  : Advanced Topics  Lab: Advanced Troubleshooting Session 11 TBA Session 12 TBA ========================================================================= ========================================================================= Table of Contents Linux-The Complete Reference, Sixth Edition ========================================================================= Introduction Part I - Introduction Ch. 1 - Introduction to Linux Ch. 2 - Getting Started Part II - The Linux Shell and File Structure Ch. 3 - The Shell Ch. 4 - The Shell Scripts and Programming Ch. 5 - Shell Configuration Ch. 6 - Linux Files, Directories, and Archives Part III - Desktop Ch. 7 - The X Window System, Xorg, and Display Managers Ch. 8 - GNOME Ch. 9 - KDE Part IV - Linux Software Ch. 10 - Software Management Ch. 11 - Office and Database Applications Ch. 12 - Graphics Tools and Multimedia Ch. 13 - Mail and News Clients Ch. 14 - Web, FTP, and Java Clients Ch. 15 - Network Tools Part V - Security Ch. 16 - Encryption, Integrity Checks, and Signatures Ch. 17 - Security-Enhanced Linux Ch. 18 - IPsec and Virtual Private Networks Ch. 19 - Secure Shell and Kerberos Ch. 20 - Firewalls Part VI - Internet and Network Services Ch. 21 - Managing Services Ch. 22 - FTP Servers Ch. 23 - Web Servers Ch. 24 - Proxy Servers Ch. 25 - Mail Servers Ch. 26 - Print, News, Search, and Database Servers Part VII - System Administration Ch. 27 - Basic System Administration Ch. 28 - Managing Users Ch. 29 - File Systems Ch. 30 - RAID and LVM Ch. 31 - Devices and Modules Ch. 32 - Kernel Administration Ch. 33 - Backup Management Part VIII - Network Administration Services Ch. 34 - Administering TCP/IP Networks Ch. 35 - Network Autoconfiguration with IPv6, DHCPv6, and DHCP Ch. 36 - NFS and NIS Ch. 37 - Distributed Network File Systems Where to Obtain Linux Distributions Index List of Figures List of Tables =========================================================================