One of the most important attitudes the system administrator must adopt is this: you have to know how the system does what it does in order to use it effectively. For this reason, Linux is a system administrator's, as well as an educator's, dream, and to a large extent, Windows is their worst nightmare. There is a lot to learn in this course, so our approach will to be to use Linux as our primary platform, and indicate parallels and differences with Windows as we progress. When we must use Windows, as we must during our cross-platform file and print service labs, we will not shy away from doing so. But we will learn much more about system administration by working with an operating system that invites the administrator to learn everything they need to learn. That OS would be Linux.
The DVD-ROM you have been given is a self-contained, bootable Linux distribution built by Professor Koehler and based on the Linux From Scratch project. The goal for week 1 is to learn how to use it as a stand-alone operating system, without installing it on your hard drive.
Over the entire course, you will often be entering commands and data which can seriously damage your system if you type the wrong thing. So before we get started, let's establish one ground rule:You will find repeatedly that it is vitally important for you to know the details of your PC hardware. This distribution has been built for 32-bit Intel-compatible processors of Pentium Pro class or higher. It will not work on older processors (for instance, Pentiums or AMD K6s). It has been tested with the PCs in Muntz 265 (henceforward called "the lab PCs"); as is so often the case, your mileage may vary... There is no warranty of any kind, but bug reports will be cheerfully considered and possibly fixed. Expect problems to occur; it will make this course more like real life.Never push the Enter key before reading what you typed and making sure it is correct!You will have a longer and happier life if you can adhere to this rule.
On some systems, you must change the order back to what it was to allow booting from the hard drive once more. Other systems are more intelligent...
Also, the vast majority of commands and data values in Linux are lower case; Linux is case-sensitive, so take care to only use upper case when it is necessary.
linuxand push the Enter key to boot Linux.
"linux" is the label of the compressed kernel image (the file which contains the kernel) on the El Torito floppy image. Our kernel version is 3.13.3, denoting major release 3, minor release 13 and revision 3.
RAMDVD-ROM drives typically have access times 20-30 times slower than hard drives. Running off a DVD-ROM is therefore usually a slow process, and you will definitely notice this. In addition, the DVD-ROM is obviously read-only, so you can't modify any of its files. By answering "RAM", the startup process will create a 64 MB ram disk for /var, to provide you with a place to modify files.
This requires 64 MB of free RAM over and above the kernel and any software you care to run. For this reason, this distribution will only run well on PCs with at least 256 MB of RAM.
If any of these are entered incorrectly, networking will not function properly. Do not answer "yes" to the final question until you are sure you have everything correct.
Question Answer hostname cpnn.lab265 IP address 192.168.1.pnn IP of gateway 192.168.1.1 Number of bits in network portion of IP address 24 Broadcast Address 192.168.1.255 IP of DNS server 10.228.64.129
In Windows, these parameters are specified using the "Network Connections" control panel. Choose the interface to configure, then choose Properties, then choose TCP/IP and finally choose Properties again.
If your PC is permanently connected to an Internet Service Provider, you may enter DHCP (Dynamic Host Configuration Protocol) for the IP address and the next four answers will be discovered automatically during network startup.
"root" is the login name for the system administrator. root can do anything, and the system usually assumes that anyone logged in as root knows what they are doing. For this reason, in week 3 we will create an ordinary (non-root) user using the useradd and passwd commands, which you will use to do most of your work. You can log in as the ordinary user, and use the su command to change to root temporarily if you need to do something privileged.
In 265, the root password MUST BE lab265. Throughout the course, I will connect to your system as root in order to check your progress, so everyone's root password must be the same. ANYWHERE ELSE you should choose a combination of upper and lower case letters and numbers, at least 8 characters long, which you can link to a phrase and/or date which you can remember. DO NOT WRITE IT DOWN - system administrators should be able to remember their passwords.
The window manager used in this distribution is called WindowMaker. In general, try left-clicking, left-double-clicking, left-dragging, right-clicking and scroll-wheel-clicking on every window and desktop widget you can find (title bars, scroll buttons, etc.) and you will know everything there is to know about the window manager.
The command prompt has the form "user [ currentworkingdirectory ]$", for instance
ken [ ~ ]$or
root [ /etc ]#where the tilde ("~") indicates the user's home directory (in the first case, /home/ken). Note that for root, "#" replaces "$", and the prompt is in red instead of green.
As the name "command prompt" implies, the first thing you enter must be either a built-in shell command or the name of an executable program or script. After the command, and usually separated by spaces, come any parameters which might be necessary.
Note that two programs are already running: xclock, in the lower left corner, and xosview (which monitors system activity) in the upper right.
You will sometimes need to terminate a command before it finishes. To do this, enter Ctrl-C.Xterm provides a window with a shell to process UNIX commands (sort of like the Windows command prompt, but equipped with warp drive and a time machine). Use multiple Xterm windows to do several things at once at command prompts. A couple xterm parameters of note are:
The system is set up to use bash for the shell. Bash supports filename completion (type a partial file name and push the Tab key, and bash will attempt to find the correct file and fill in the rest of its name) and command history (accessed by using the up and down cursor arrows on the keyboard).
The filesystem on our Linux distribution looks (in part) like this:/ - this is the root of the filesystem (comparable to "C:")
- bin - this is where essential system programs are kept (comparable to "C:\Windows\System32")
- boot - this is where information necessary to boot Linux is kept (like NTLDR and BOOT.INI in "C:\")
- dev - device files are stored here
- etc - configuration files are stored here (somewhat comparable to the registry)
- home - non-root users' home directories are kept here (sort of like "C:\Documents and Settings")
- include - API header files are stored here
- lib - system libraries are stored here (like .dll files in "C:\Windows\System32")
- lost+found - if your filesystem is damaged, pieces of damaged files are placed here
- media - contains several mount points (more in week 2)
- mnt - a mount point (somewhat like drive letters)
- opt - some "optional" software is stored here
- proc - a "pseudo-filesystem", which provides a window on the running operating system (more in week 4)
- root - root's home directory
- run - another pseudo-filesystem, containing system volatile data
- sbin - contains system programs normally only run by root (like some .exe files in "C:\Windows\System32")
- srv - server data is kept here
- sys - another pseudo-filesystem
- tmp - where temporary files are created; any user can write to this directory (comparable to "C:\Windows\Temp")
- usr - where the vast majority of the system software and documentation lives (sort of like "C:\Program Files")
- var - information used during system operation is stored here
Note that etc, home, root, srv and tmp are symbolic links (like short-cuts) to directories of the same names in /var. All subdirectories of the root directory (/) which contain files which are usually modifiable have been consolidated in /var, which is on the RAM disk. The remaining directories in the root filesystem are accessed from the DVD-ROM.Note too that there are copies of all of the top-level directories in /var (for instance, etc) on the root filesystem, but once /var is mounted, they are not accessible. However, the contents of certain files and directories (fstab, inittab and rc.d) must be the same on both filesystems. This is because they are accessed before and after /var is mounted during the startup process.
To search for text within a web page, just click in the window and type the text you wish to find. You can find additional occurrences using "Ctrl-g". You will first have to set "Find As You Type" (in Edit/Preferences/Advanced/Find As You Type) to "Any text in the page".To see how the DVD-ROM was built, choose "Open File" from the File menu and choose "/root/rwclfs.html".
Note that as you move your mouse over first the seamonkey window and then the xterm window that the color of the title bar changes; this is called input focus; the window in focus (dark title bar) is the one which receives keystrokes from the keyboard.
For many of the dock programs, you can also paste into the icon. If you have copied a file name, the program will open that file.
If you enter "/(pattern)" and push the Enter key, less will search forward until it finds the next occurrence of "pattern". Each time you push the "n" key, it goes to the next occurrence of "pattern"; each time you push the "N" key, it goes to the previous occurrence of "pattern".
Your path is displayed by echo $PATH; it is a list of all of the directories in which bash will search for commands to execute when you enter one at the command prompt. PATH is an environment variable; an environment variable must be preceded by a dollar sign to refer to its current value.xman can be started from an xterm window and used to examine which manual pages are available by section, and read those of interest. Sections of interest are:
Nearly all commands have some default behavior (which takes place if options or parameters are left off). Be aware of the default behavior of the commands you use; as an example, if the user parameter is left off of the passwd command, the password of the user running the command is changed!Many of the man pages are "incomplete"; in these cases, the real documentation is in the "info" page. For instance, man grub produces a short summary of the grub command, while info grub is a small book on the subject. info navigation uses the following keys:
In addition to these resources, there is a vast amount of documentation in the directory /usr/share. Most of it is either plain text files or HTML; it is organized by package, and is often found in a subdirectory called "doc".
To shut down the system, enter either shutdown -h now or reboot or Ctrl-Alt-Delete at the command prompt (after exiting X-windows).
The single most common cause of PC problems is improperly-terminated software.
©2015, Kenneth R. Koehler. All Rights Reserved. This document may be freely reproduced provided that this copyright notice is included.
Please send comments or suggestions to the author.