Table of Contents
List of Tables
Table of Contents
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Slackware has a long tradition of excellence. Started in 1992 and first released in 1993, Slackware is the oldest surviving commercial Linux distribution. Slackware's focus on making a clean, simple Linux distribution that is as UNIX-like as possible makes it a natural choice for those people who really want to learn about Linux and other UNIX-like operating systems. Slackware's simplicity makes it ideal for those users who want to create their own custom systems. And of course, Slackware is great in its own right as a desktop, workstation, or server.
There are a great number of differences between Slackware and other main-stream distributions such as Red Hat, Debian, and Ubuntu. Perhaps the greatest difference is the lack of "hand-holding" that Slackware will do for the administrator. Many of these other distributions ship with graphical configuration tools for all manner of services. In many cases these configuration tools are the preferred method of setting up applications on these systems and will over-write any changes you make to the config files via other means. These tools often make it easy (or at least possible) for a rookie with no in-depth understanding of his system to setup basic services; however, they also make it difficult to do anything too out of the ordinary. In contrast, Slackware expects you, the system administrator, to do these tasks on your own. Slackware provides no general purpose setup tools beyond those included with the source code published by up-stream developers. This means there is often a somewhat steeper learning curve associated with Slackware, even for those users familiar with other Linux distributions, but also makes it much easier to do whatever you want with your operating system.
Also, you may hear users of other distributions say that Slackware has no package management system. This is completely and obviously false. Slackware has always had package management (see Chapter 16 for more information). What it does not have is automatic dependency resolution. Rather, Slackware's package tools trade dependency management for simplicity, ease-of-use, and reliability.
Each piece of Slackware (indeed of all Linux distributions) is developed by different people or teams of people, and each group has their own ideas about what it means to be "free". Because of this there are literally dozens and dozens of different licenses granting you different permissions regarding their use or distribution.
Perhaps the most popular license in use within the Free Software community is the GNU General Public License. The GPL was created by the Free Software Foundation which actively works to create and distribute software that contains the basic freedoms they fill are basic rights. Indeed, this is the very group that coined the term "Free Software". The GPL imposes no restrictions on the use of software. In fact, you don't even have to accept the terms of the license in order to use the software, but you are not allowed to distribute the software or your changes to it without abiding by the terms of the license agreement. A great many software projects shipped with Slackware from the Linux kernel itself to the Samba project are released under the terms of the GPL.
Another very common license is the BSD license, which is arguably "more free" than the GPL, but imposes no restrictions on derivative works. The BSD license simply requires that the copyright remain intact, along with a simple disclaimer. Many of the utilities specific to Slackware are licensed with a BSD-style license.
Table of Contents
Slackware's installation is a bit more simplistic than many other Linux distributions use, and is very reminiscent of installing one of the varieties of BSD operating systems. If you're familiar with those, you should feel right at home. If you've never installed Slackware or used a distribution that makes use of a non-graphical installer, you may feel a bit overwhelmed. Don't panic. The installation is very easy once you understand it, and works on just about any x86 platform.
The latest versions of Slackware Linux are distributed on DVD or CD media, but Slackware can be installed in a variety of other ways. This book will only focus on the most common way: installing via optical media. In order to install Slackware, you'll need at least an Intel 486 or equivilant CPU, but we recommend you obtain a 586 or better CPU if at all possible. Slackware can be pared down to run on as little as 32 MB of RAM (or even less), but with the size of the 2.6 kernel and user-space applications, you will find yourself having a much easier time if you have a minimum of 64 MB of RAM. If you wish to use anything older than these, you might want to obtain an older copy of Slackware which will perform better with fewer CPU Megahertz and less RAM.
FILL THIS IN! FILL THIS IN! FILL THIS IN! FILL THIS IN! FILL THIS IN! FILL THIS IN! FILL THIS IN! FILL THIS IN! FILL THIS IN! FILL THIS IN! FILL THIS IN! FILL THIS IN! FILL THIS IN! FILL THIS IN!
Unlike many other Linux distributions, Slackware does not make use of a graphical disk partitioning tool in its installer. Rather, Slackware makes use of fdisk(8) and cfdisk(8), both console tools. cfdisk is a curses-based partitioning tool while fdisk is not. Whichever you choose to use should only rarely matter. In this book, we'll only discuss fdisk.
In order to partition your hard drive, you'll first need to know how to
identify it. In Linux, all hardware is identified by a special file
called a device file. These are all (typically) located in the
/dev
directory. If your hard drive is IDE, you
will most likely find it as /dev/hda
; however,
many hard drives today including SATA disks are identified as SCSI
devices by the kernel. If you don't know what your hard drive is
identified in Linux as, fdisk can help you
out.
root@slackware:/#
fdisk -l
Disk /dev/sda: 72.7 GB, 72725037056 bytes 255 heads, 63 sectors/track, 8841 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Here, you can see that my system has a hard drive located at
/dev/sda
that is 72.7 GB in size. You can also
see some additional info about this hard drive. (In my case, this is
actually three SCSI hard drives on a hardware RAID controller that
makes them appear as a single drive.) The [-l] argument to
fdisk tells it to display the hard drives
and all the partitions it finds on those drives, but won't make any
changes to the disks. In order to actually partition our drives, we'll
have to tell fdisk what drive to operate on.
root@slackware:/#
fdisk /dev/sda
The number of cylinders for this disk is set to 8841. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help):
Now we've told fdisk what disk we wish to partition and it has dropped us into command mode after printing an annoying warning message. The 1024 cylinder limit has not been a problem for some time, and Slackware's boot loader will have no trouble booting disks larger than this. Typing [m] and hitting ENTER will print out a helpful message telling you what to do with fdisk.
Command (m for help): m
FILL THIS IN! FILL THIS IN!
FILL THIS IN! FILL THIS IN!
FILL THIS IN! FILL THIS IN!
FILL THIS IN! FILL THIS IN!
FILL THIS IN! FILL THIS IN!
FILL THIS IN! FILL THIS IN!
FILL THIS IN! FILL THIS IN!
Now that we know what commands will do what, it's time to begin to
partition our drive. At a minimum, you will need a single
/
partition and should create a swap partition.
You might also want to make a seperate /home
partition for storing user files (this will make it easier to upgrade
later, or install a different Linux operating system by keeping all of
your users' files on a seperate partition). So, let's go ahead and
make three partitions. The command to create a new partition is
[n] (which you would have noticed if you read the help).
Command: (me for help):n
Command action e extended p primary partition (1-4)p
Partition number (1-4):1
First cylinder (1-8841, default 1):1
Last cylinder or +size or +sizeM or +sizeK (1-8841, default 8841):+8G
Command (m for help): n Command action e extended p primary partition (1-4)p
Partition number (1-4):2
First cylinder (975-8841, default 975):975
Last cylinder or +size or +sizeM or +sizeK (975-8841, default 8841):+1G
Here we have created two partitions. The first is 8GB in size and the second is only 1GB. We can view our existing partitions with the [p] command.
Command (m for help): p
Disk /dev/sda: 72.7 GB, 72725037056 bytes
255 heads, 63 sectors/track, 8841 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 974 7823623+ 83 Linux
/dev/sda2 975 1097 987997+ 83 Linux
Both of these partitions are of type "83" which is the standard Linux
filesystem. We will need to change /dev/sda2
to
type "82" in order to make this a swap partition. We will do this with
the [t] command.
Command (m for help):t
Partition number (1-4):2
Hex code (type L to list codes):82
Command (me for help):p
Disk /dev/sda: 72.7 GB, 72725037056 bytes 255 heads, 63 sectors/track, 8841 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 1 974 7823623+ 83 Linux /dev/sda2 975 1097 987997+ 82 Linux swap
The swap partition is a special partition that is used for virtual memory by the Linux kernel. If for some reason you run out of RAM, the kernel will move the contents of some of the RAM to swap in order to prevent a crash. The size of your swap partition is up to you. A great many people have participated have participated in a great many flamewars on the size of swap partitions, but a good rule of thumb is to make your swap partition about twice the size of your system's RAM. Since my machine has only 512MB of RAM, I decided to make my swap partition 1GB. You may wish to experiment with your swap partition's size and see what works best for you, but generally there is no harm in having "too much" swap.
At this point we can stop, write these changes to the disk, and
continue on, but I'm going to go ahead and make a third partition which
will be mounted at /home
.
Command: (me for help):n
Command action e extended p primary partition (1-4)p
Partition number (1-4):3
First cylinder (1098-8841, default 1098):1098
Last cylinder or +size or +sizeM or +sizeK (1098-8841, default 8841):8841
Now it's time to finish up and write these changes to disk.
Command: (me for help):w
The partition table has been altered! Calling ioctl() to re-read partition table. Synching disks.root@slackware:/#
At this point, we are through partitioning our disks and are ready to begin the setup program. However, if you have created any extended partitions, you may wish to reboot once to ensure that they are properly read by the kernel.
Ok, now that you've gotten Slackware installed on your system, you should learn exactly what controls the boot sequence of your machine, and how to fix it should you manage to break it somehow. Use Linux long enough, and sooner or later you will make a mistake that breaks your bootloader. Fortunately, this doesn't require a re-install to fix. Unlike many other operating systems that hide the underlying details of how they work, Linux (and in particular, Slackware) gives you full control over the boot process. Simply by editing a configuration file or two and re-running the boot-loader installer, you can quickly and easily change (or break) your system. Slackware even makes it easy to dual-boot between multiple operating systems such as other Linux distributions or Microsoft Windows.
Before we go any further, a quick discussion on the Linux kernel is warranted. Slackware Linux includes several different kernels. While they are all compiled from the same source code, and hence are the "same", they are not identical. Depending on your architecture and Slackware version, the installer may have loaded your system with several kernels. There are kernels for single-processor systems and kernels for multi-processor systems. In the old days, there were tons of kernels for installing on different kinds of hard drive controllers. More importantly for our discussion, there are "huge" kernels and "generic" kernels.
If you look inside your /boot
directory, you'll
see the various kernels installed on your system.
darkstar:~#
ls -l /boot/vmlinuz*
/boot/vmlinuz-huge-2.6.29.4 /boot/vmlinuz-generic-2.6.29.4
Here you can see that I have two kernels installed,
vmlinuz-huge-2.6.29.4
and
vmlinuz-generic-2.6.29.4
. Each Slackware release
includes different kernel versions and sometimes even slightly
different names, so don't be alarmed if what you see doesn't exactly
match what I have listed here.
Huge kernels are exactly what you might think; they're huge. These kernels are built to support nearly every conceivable computer Slackware is supported on. They most certainly contain support for hardware your machine does not, and never will, have. These are included for several reasons, but the most important perhaps is in use by the installer. These are the kernels the Slackware installation disks run. If you chose to let the installer configure your bootloader for you, it chooses to use these kernels due to the incredible variety of hardware they support. By contrast, the generic kernels support very little hardware without the use of external modules. If you want to use one of the generic kernels, you'll need to make use of something called an initrd, and the tool to make them, mkinitrd(8).
So why should you use a generic kernel? Currently the Slackware development team recommends use of a generic kernel for a variety of reasons. Perhaps the most obvious is size. The huge kernels are currently about twice the size of the generic kernels before they are uncompressed and loaded into memory. If you are running an older machine, or one with some small ammount of RAM, you will appreciate the savings the generic kernels offer you. Other reasons are somewhat more difficult to quantify. Conflicts between drivers included in the huge kernels do appear from time-to-time, and generally speaking, the huge kernels do not perform as well as the generic ones. Also, by using the generic kernels, special arguments can be passed to hardware drivers seperately, rather than requiring these options be passed on the kernel command line. Some of the tools included with Slackware work better if your kernel uses some drivers as modules rather than "hard-coding" them into the kernel. If you're having trouble understanding this, don't be alarmed, just think "huge kernel: good, generic kernel: better".
Unfortunately, using the generic kernels isn't as straight-forward as using the huge kernels. In order for the generic kernel to boot your system, you must also usually include a few basic modules in an initird. Modules are pieces of compiled kernel code that can be inserted or removed from a running kernel. This makes the system somewhat more flexible at the cost of a tiny bit of added complexity. You might find it easier to think of modules as device drivers, at least for this section. Typically you will need to add the module for whatever filesystem you chose to use for your root partition during the installer. If your root partition is located on a SCSI disk or RAID controller, you'll need to load those modules as well. Finally, if you're using software RAID, disk encryption, or LVM, you'll also need to create an initrd whether you're using the generic kernel or not.
initrds are compressed cpio(1) archives, so creating them isn't very straightforward. Fortunately for you, Slackware includes a tool that makes this very easy, mkinitrd. A full discussion of mkinitrd is a bit beyond the scope of this book, but we'll show you all the highlights. For a more complete explanation, check the manpage or run mkinitrd with the [--help] argument.
darkstar:~#
mkinitrd --help
mkinitrd creates an initial ramdisk (actually an initramfs cpio+gzip archive) used to load kernel modules that are needed to mount the root filesystem, or other modules that might be needed before the root filesystem is available. Other binaries may be added to the initrd, and the script is easy to modify. Be creative. :-) .... many more lines deleted ....
When using mkinitrd, you'll need to know a few items of information: your root partition, your root filesystem, any hard disk controllers you're using, and whether or not you're using LVM, software RAID, or disk encryption. Unless you're using some kind of SCSI controller (and have your root partition loaded on the SCSI controller), you should only need to know your root filesystem and partition type. Assuming you've booted into your Slackware installation using the huge kernel, you can easily find this information with the mount command.
darkstar:~#
mount
/dev/sda1 on / type ext4 (rw,barrier=1,data=ordered) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) usbfs on /proc/bus/usb type usbfs (rw) /dev/sda2 on /home type jfs (rw) tmpfs on /dev/shm type tmpfs (rw)
In the example provided, you can see that the root partition is located
on /dev/sda1
and is an ext4 type partition. If we
want to create an initrd for this system, we simply need to tell this
information to mkinird.
darkstar:~#
mkinitrd -f ext4 -r /dev/sda1
Note that in most cases, mkinitrd is smart enough to determine this information on its own, but it never hurts to specify it manually. Now that we've created out initrd, we simply need to tell LILO where to find it. We'll focus on that in the next section.
Looking up all those different options for
mkinitrd or worse, memorizing them, can be a
real pain though, especially if you try out different kernels
consistently. This became tedious for the Slackware development team,
so they came up with a simple configuration file,
mkinitrd.conf
(5). You can find a sample file that
can be easily customized for your system under the
/etc
directory. Here's mine.
# mkinitrd.conf.sample # See "man mkinitrd.conf" for details on the syntax of this file # SOURCE_TREE="/boot/initrd-tree" CLEAR_TREE="0" OUTPUT_IMAGE="/boot/initrd.gz" KERNEL_VERSION="$(uname -r)" #KEYMAP="us" MODULE_LIST="ext3:ext4:jfs" #LUKSDEV="/dev/hda1" ROOTDEV="/dev/raven/64root" ROOTFS="ext4" #RESUMEDEV="/dev/hda2" #RAID="0" LVM="1" #WAIT="1"
For a complete description of each of these lines and what they do,
you'll need to consulte the man page for
mkinitrd.conf
. Once each of these is setup, you
need only run mkinitrd with the
[-F] argument. A proper initrd file will be constructed and
installed for you, without you having to remember all those obscure
arguments.
LILO is the Linux Loader, and currently the default boot loader
installed with Slackware Linux. If you've used other Linux
distributions before, you may be more familiar with GRUB. If you prefer
to use it, you can easily find it in the extra/
directory on one of your Slackware CDs. Since LILO is the default
Slackware bootloader however, we'll focus exclusively on it.
Configuring LILO can be a little daunting for new users, so Slackware comes with a special setup tool, liloconfig. Normally, liloconfig is first run by the installer, but you can run it at anytime from a terminal.
FILL THIS IN!!!! Picture of liloconfig
liloconfig has two modes of operation:
simple and expert. The simple mode tries to automatically configure
lilo for you. If Slackware is the only operating system installed on
your computer, the simple mode will almost always do the right thing
quickly and easily. It is also very good at detecting Windows
installations and adding them to the lilo.conf
file so that you can choose which operating system to boot when you
turn your computer on.
In order to use expert mode, you'll need to know Slackware's root partition. You can also setup other linux operating systems if you know their root partitions, but this may not work as well as you'd expect. liloconfig will try to boot each linux operating system with Slackware's kernel, and this is probably not what you want. Fortunately, setting up Windows partitions in expert mode is trivial. One hint when using expert mode. You should almost always install LILO to the Master Boot Record (MBR). Once upon a time, it was recommended to install the boot loader onto the root partition and set that partition as bootable. Today, LILO has matured greatly and is safe to install on the MBR. In fact, you will encounter fewer problems if you do so.
liloconfig is a great way to quickly setup
your boot loader, but if you really need to know what's going on you'll
need to look at LILO's configuration file,
lilo.conf
(5) under the /etc
directory. The lilo.conf
file is seperated into
several sections. At the top you'll find a global section where you
specify things like where to install LILO (generally the MBR), any
special images or screens to show on boot, and the timeout after which
LILO will boot the default operating system. Here's what the global
section of my lilo.conf file looks like in part.
# LILO configuration file boot = /dev/sda bitmap = /boot/slack.bmp bmp-colors = 255,0,255,0,255,0 bmp-table = 60,6,1,16 bmp-timer = 65,27,0,255 append=" vt.default_utf8=0" prompt timeout = 50 # VESA framebuffer console @ 1024x768x256 vga = 773 .... many more lines ommitted ....
For a complete listing of all the possible LILO options, you should
consult the man page for lilo.conf
. In brief,
we'll discuss the most common in this document.
The first thing that should draw your attention is the boot line. This
determines where the bootloader is installed. In order to install the
the MBR of your hard drive, you simply list the hard drive's device
entry on this line. In my case, I'm using a SATA hard drive that shows
up as SCSI device /dev/sda
. If you're using an IDE
drive, you will probably have to use /dev/hda
. In
order to install to the boot block of a partition, you'll have to list
the partition's device entry. For example, if you are installing to the
first partition on the only SATA hard drive in your computer, you would
probably use /dev/sda1
.
The prompt option simply tells LILO to ask (prompt) you for which
operating system to boot. Operating systems are each listed in their
own section deeper in the file. We'll get to them in a minute. The
timeout option tells LILO how long to wait (in tenths of seconds)
before booting the default OS. In my case, this is 5 seconds. Some
systems seem to take a very long time to display the boot screen, so
you may need to use a larger timeout value than I have set. This is in
part why the simple LILO installation method utilizes a very long
timeout (somewhere around 2 whole minutes). The append line in my case
was setup by liloconfig. You may (and
probably should) see something similar when looking at your own
lilo.conf
. I won't go into the details of why this
line is needed, so you're just going to have to trust me that things
work better if it is present. :^)
Now that we've looked into the global section, let's take a look at the
operating systems section. Each linux operating system section begins
with an "image" line. Microsoft Windows operating systems are specified
with an "other" line. Let's take a look at a sample
lilo.conf
that boots both Slackware and Microsoft
Windows.
# LILO configuration file ... global section ommitted .... # Linux bootable partition config begins image = /boot/vmlinuz-generic-2.6.29.4 root = /dev/raven/64root initrd = /boot/initrd.gz label = Slackware64 read-only # Linux bootable partition config ends # Windows bootable partition config begins other = /dev/sda3 label = Windows table = /dev/sda # Windows bootable partition config ends
For Linux operating systems like Slackware, the image line specifies
which kernel to boot. In this case, we're booting
/boot/vmlinuz-generic-2.6.29.4
. The remaining
sections are pretty self-explainatory. The tell LILO where to find the
root filesystem, what initrd (if any) to use, and to initially mount
the root filesystem read-only. That initrd line is very important for
anyone running a generic kernel, or using LVM or software RAID. It
tells LILO (and the kernel) where to find the initrd you created using
mkinitrd.
Once you've gotten your lilo.conf
setup for your
machine, simply run lilo(8) to install it.
Unlike GRUB and other bootloaders, LILO requires you re-run
lilo anytime you make changes to its
configuration file in order for those changes to be installed.
darkstar:~#
lilo
Warning: LBA32 addressing assumed Warning: '/proc/partitions' does not match '/dev' directory structure. Name change: '/dev/dm-0' -> '/dev/raven/swap' Warning: Name change: '/dev/dm-1' -> '/dev/raven/root' Warning: Name change: '/dev/dm-2' -> '/dev/raven/home' Warning: Name change: '/dev/dm-3' -> '/dev/raven/src' Warning: Name change: '/dev/dm-4' -> '/dev/raven/64root' Added Slackware * Added Backup 6 warnings were issued.
Don't be scared by many of the warnings you may see when running lilo. In my case, most of these warnings are issued by the use of LVM. Unless you see a fatal error, things should be just fine.
Table of Contents
So you've installed Slackware and you're staring at a terminal prompt, what now? Now would be a good time to learn about the basic command line tools. And since you're staring at a blinking curser, you probably need a little assistance in knowing how to get around, and that is what this chapter is all about.
Your Slackware Linux system comes with lots of built-in documentation
for nearly every installed application. Perhaps the most common method
of reading system documentation is by using the
man(1). man
(short for manual) will bring up the included man-page for any
application, system call, configuration file, or library you tell it
too. For example, man man
will bring up the
man-page for man itself.
Unfortunately, you may not always know what application you need to use for the task at hand. Thankfully, man has built-in search abilities. Using the [-k] switch will cause man to search for every man-page that matches your search terms.
The man-pages are organized into groups or sections by their content type. For example, section 1 is for user applications. man will search each section in order and display the first match it finds. Sometimes you will find that a man-page exists in more than one section for a given entry. In that case, you will need to specify the exact section to look in. In this book, all applications and a number of other things will have a number on their right-hand side in parenthesis. This number is the man page section where you will find information on that tool.
darkstar:~$
man -k printf
printf (1) - format and print data printf (3) - formatted output conversiondarkstar:~$
man 3 printf
Table 4.1. Man Page Sections
Section | Contents |
---|---|
1 | User Commands |
2 | System Calls |
3 | C Library Calls |
4 | Devices |
5 | File Formats / Protocols |
6 | Games |
7 | Conventions / Macro Packages |
8 | System Administration |
ls(1) is used to list files and directories,
their permissions, size, type, inode number, owner and group, and
plenty of additional information. For example, let's list what's in
the /
directory for your new Slackware Linux system.
darkstar:~$
ls /
bin/ dev/ home/ lost+found/ mnt/ proc/ sbin/ sys/ usr/ boot/ etc/ lib/ media/ opt/ root/ srv/ tmp/ var/
Notice that each of the listings is a directory. These are easily distinguished from regular files due to the trailing /; standard files do not have a suffix. Additionally, executable files will have an asterisk suffix. But ls can do so much more. To get a view of the permissions of a file or directory, you'll need to do a "long list".
darkstar:~$
ls -l /home/alan/Desktop
-rw-r--r-- 1 alan users 15624161 2007-09-21 13:02 9780596510480.pdf -rw-r--r-- 1 alan users 3829534 2007-09-14 12:56 imgscan.zip drwxr-xr-x 3 alan root 168 2007-09-17 21:01 ipod_hack/ drwxr-xr-x 2 alan users 200 2007-12-03 22:11 libgpod/ drwxr-xr-x 2 alan users 136 2007-09-30 03:16 playground/
A long listing lets you view the permisions, user and group ownership, file size, last modified date, and of course, the file name itself. Notice that the first two entires are files, and the last three are directories. This is denoted by the very first character on the line. Regular files get a "-"; directories get a "d". There are several other file types with their own denominators. Symbolic links for example will have an "l".
Lastly, we'll show you how to list dot-files, or hidden files. Unlike other operating systems such as Microsoft Windows, there is no special property that differentiates "hidden" files from "unhidden" files. A hidden file simply begins with a dot. To display these files along with all the others, you just need to pass the [-a] argument to ls.
darkstar:~$
ls -a
.xine/ .xinitrc-backup .xscreensaver .xsession-errors SBo/ .xinitrc .xinitrc-xfce .xsession .xwmconfig/ Shared/
You also likely noticed that your files and directories appear in different colors. Many of the enhanced features of ls such as these colors or the trailing characters indicating file-type are special features of the ls program that are turned on by passing various arguments. As a convienience, Slackware sets up ls to use many of these optional arguments by default. These are controlled by the LS_OPTIONS and LS_COLORS environment variables. We will talk more about environment variables in chapter 5.
cd is the command used to change directories. Unlike most other commands, cd is actually not it's own program, but is a shell built-in. Basically, that means cd does not have its own man page. You'll have to check your shell's documentation for more details on the cd you may be using. For the most part though, they all behave the same.
darkstar:~$
cd /
darkstar:/$
ls
bin/ dev/ home/ lost+found/ mnt/ proc/ sbin/ sys/ usr/ boot/ etc/ lib/ media/ opt/ root/ srv/ tmp/ var/darkstar:/$
cd /usr/local
darkstar:/usr/local$
Notice how the prompt changed when we changed directories? The default Slackware shell does this as a quick, easy way to see your current directory, but this is not actually a function of cd. If your shell doesn't operate in this way, you can easily get your current working directory with the pwd(1) command. (Most UNIX shells have configurable prompts that can be coaxed into providing this same functionality. In fact, this is another convience setup in the default shell for you by Slackware.)
darkstar:~$
pwd
/usr/local
While most applications can and will create their own files and directories, you'll often want to do this on your own. Thankfully, it's very easy using touch(1) and mkdir(1).
touch actually modifies the timestamp on a file, but if that file doesn't exist, it will be created.
darkstar:~/foo$
ls -l
-rw-r--r-- 1 alan users 0 2008-01-18 15:01 bar1darkstar:~/foo$
touch bar2
-rw-r--r-- 1 alan users 0 2008-01-18 15:01 bar1 -rw-r--r-- 1 alan users 0 2008-01-18 15:05 bar2darkstar:~/foo$
touch bar1
-rw-r--r-- 1 alan users 0 2008-01-18 15:05 bar1 -rw-r--r-- 1 alan users 0 2008-01-18 15:05 bar2
Note how bar2
was created in our second command,
and the third command simpl updated the timestamp on
bar1
mkdir is used for (obviously enough) making
directories. mkdir foo
will create the
directory "foo" within the current working directory. Additionally,
you can use the [-p] argument to create any
missing parent directories.
darkstar:~$
mkdir foo
darkstar:~$
mkdir /slack/foo/bar/
mkdir: cannot create directory `/slack/foo/bar/': No such file or directorydarkstar:~$
mkdir -p /slack/foo/bar/
In the latter case, mkdir will first create "/slack", then "/slack/foo", and finally "/slack/foo/bar". If you failed to use the [-p] argument, man would fail to create "/slack/foo/bar" unless the first two already existed, as you saw in the example.
Removing a file is as easy as creating one. The rm(1) will remove a file (assuming of course that you have permission to do this). There are a few very common arguments to rm. The first is [-f] and is used to force the removal of a file that you may lack explicit permission to delete. The [-r] argument will remove directories and their contents recursively.
There is another tool to remove directories, the humble rmdir(1). rmdir will only remove directories that are empty, and complain noisely about those that contain files or sub-directories.
darkstar:~$
ls
foo_1/ foo_2/darkstar:~$
ls foo_1
bar_1darkstar:~$
rmdir foo_1
rmdir: foo/: Directory not emptydarkstar:~$
rm foo_1/bar
darkstar:~$
rmdir foo_1
darkstar:~$
ls foo_2
bar_2/darkstar:~$
rm -fr foo_2
darkstar:~$
ls
Traditionally, UNIX and UNIX-like operating systems are filled with text files that at some point in time the system's users are going to want to read. Naturally, there are plenty of ways of reading these files, and we'll show you the most common ones.
In the early days, if you just wanted to see the contents of a file (any file, whether it was a text file or some binary program) you would use cat(1) to view them. cat is a very simple program, which takes one or more files, concatenates them (hence the name) and sends them to the standard output, which is usually your terminal screen. This was fine when the file was small and wouldn't scroll off the screen, but inadequate for larger files as it had no built-in way of moving within a document and reading it a paragraph at a time. Today, cat is still used quite extensively, but predominately in scripts or for joining two or more files into one.
darkstar:~$
cat /etc/slackware-version
Slackware 12.0.0
Given the limitations of cat some very intelligent people sat down and began to work on an application to let them read documents one page at a time. Naturally, such applications began to be known as "pagers". One of the earliest of these was more(1), named because it would let you see "more" of the file whenever you wanted. more will display the first few lines of a text file until your screen is full, then pause. Once you've read through that screen, you can proceed down one line by pressing ENTER, or an entire screen by pressing SPACE. more is also capable of searching through a text file for keywords. Once you've displayed a file in more, simply press the / key and enter a keyword. Upon pressing ENTER, the text will scroll until it finds the next match. This is clearly a big improvement over cat, but still suffers from a serious flaw: more is not able to scroll back up through the file to allow you to read something you might have missed. Clearly a better solution is called for.
In order to address the short-comings of
more, a new pager was developed and
ironically dubbed less(1).
less is a very powerful pager that supports
all of the functions of more while adding
lots of additional features. To begin with,
less allows you to use your arrow keys to
controll movement within the document. Due to its popularity, many
Linux distributions have begun to exclude
more in favor of
less. Slackware includes both. Moreover,
Slackware also includes a handy little pre-processor for
less called
lesspipe.sh
. This allows a user to exectute
less on a number of non-text files.
lesspipe.sh
will generate text output from running
a command on these files, and display it in
less.
Links are a method of referring to one file by more than one name. By using the ln(1) application, a user can reference one file with more than one name. The two files are not carbon-copies of one another, but rather are the exact same file, just with a different name. To remove the file entirely, all of its names must be deleted. (This is actually the result of the way that rm and other tools like it work. Rather than remove the contents of the file, they simply remove the reference to the file, freeing that space to be re-used. ln will create a second reference or "link" to that file.)
darkstar:~$
ln /etc/slackware-version foo
darkstar:~$
cat foo
Slackware 12.0.0darkstar:~$
ls -l /etc/slackware-version foo
-rw-r--r-- 1 root root 17 2007-06-10 02:23 /etc/slackware-version -rw-r--r-- 1 root root 17 2007-06-10 02:23 foo
Another type of link exists, the symlink. Symlinks, rather than being another reference to the same file, are actually a special kind of file in their own right. These symlinks point to another file or directory. The primary advantage of symlinks is that they can refer to directories as well as files, and they can span multiple filesystems. These are created with the [-s] argument.
darkstar:~$
ln -s /etc/slackware-version foo
darkstar:~$
cat foo
Slackware 12.0.0darkstar:~$
ls -l /etc/slackware-version foo
-rw-r--r-- 1 root root 17 2007-06-10 02:23 /etc/slackware-version lrwxrwxrwx 1 root root 22 2008-01-25 04:16 foo -> /etc/slackware-version
When using symlinks, remember that if the original file is deleted, your symlink is useless; it simply points at a file that doesn't exist anymore.
Table of Contents
Yeah, what exactly is a shell? Well, a shell is basically a command-line user environment. In essence, it is an application that runs when the user logs in and allows him to run additional applications. In some ways it is very similar to a graphical user interface, in that it provides a framework for executing commands and launching programs. There are many shells included with a full install of Slackware, but in this book we're only going to discuss bash(1), the Bourne Again Shell. Advanced users might want to consider using the powerful zsh(1), and users familiar with older UNIX systems might appreciate ksh. The truly masochistic might choose the csh, but new users should stick to bash.
All shells make certain tasks easier for the user by keeping track of
things in environment variables. An environment variable is simply a
shorter name for some bit of information that the user wishes to store
and make use of later. For example, the environment variable PS1 tells
bash how to format its prompt. Other
variables may tell applications how to run. For example, the LESSOPEN
variable tells less to run that handy
lesspipe.sh
preprocessor we talked about, and
LS_OPTIONS tuns on color for ls.
Setting your own envirtonment variables is easy. bash includes two built-in functions for handling this: set and export. Additionally, an environment variable can be removed by using unset. (Don't panic if you accidently unset an environment variable and don't know what it would do. You can reset all the default variables by logging out of your terminal and logging back in.) You can reference a variable by placing a dollar sign ($) in front of it.
darkstar:~$
set FOO=bar
darkstar:~$
echo $FOO
bar
The primary difference between set and export is that export will (naturally) export the variable to any sub-shells. (A sub-shell is simply another shell running inside a parent shell.) You can easily see this behavior when working with the PS1 variable that controls the bash prompt.
darkstar:~$
set PS1='FOO '
darkstar:~$
export PS1='FOO '
FOO
There are many important environment variables that
bash and other shells use, but one of the
most important ones you will run across is PATH. PATH is simply a list
of directories to search through for applications. For example,
top is located at
/usr/bin/top(1). You could run it simply by
specifying the complete path to it, but if
/usr/bin
is in your PATH variable,
bash will check there if you don't specify a
complete path one your own. You will most likely first notice this
when you attempt to run a program that is not in your PATH as a normal
user, for instance, ifconfig(8).
darkstar:~$
ifconfig
bash: ifconfig: command not founddarkstar:~$
echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:.
Above, you see a typical PATH for a mortal user. You can change it on your own the same as any other environment variable. If you login as root however, you'll see that root has a different PATH.
darkstar:~$
su -
Password:darkstar:~#
echo $PATH
/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin
Wildcards are special characters that tell the shell to match certain criteria. If you have experience with DOS, you'll recognize * as a wildcard that matches anything. bash makes use of this wildcard and several others to enable you to easily define exactly what you want to do.
This first and most common of these is, of course, *. The asterisk
matches any character or combination of characters, including none.
Thus b*
would match any files named b, ba, bab,
babc, bcdb, and so forth. Slightly less common is the ?. This
wildcard matches one instance of any character, so
b?
would match ba and bb, but not b or bab.
darkstar:~$
touch b ba bab
darkstar:~$
ls *
b ba babdarkstar:~$
ls b?
ba
No, the fun doesn't stop there! In addition to these two we also have the bracket pair "[ ]" which allows us to fine tune exactly what we want to match. Whenever bash see the bracket pair, it substitues the contents of the bracket. Any combination of letters or numbers may be specified in the bracket as long as they are comma seperacted. Additionally, ranges of numbers and letters may be specified as well. This is probably best shown by example.
darkstar:~$
ls a[1-4,9]
a1 a2 a3 a4 a9
Since Linux is case-sensitive, capital and lower-case letters are treated differently. All capital letters come before all lower-case letters in "alphabetical" order, so when using ranges of capital and lower-case letters, make sure to get them right.
darkstar:~$
ls 1[W-b]
1W 1X 1Y 1Z 1a 1bdarkstar:~$
ls 1[w-B]
/bin/ls: cannot access 1[b-W]: No such file or directory
In the second example, 1[b-W] isn't a valid range, so the shell treats it as a filename, and since that file doesn't exist, ls tells you so.
Still think there's entirely too much work involved with using wildcards? You're right. There's an even easier way when you're dealing with long filenames: tab completion. Tab completion enables you to type just enough of the filename to uniquely identify it, then by hitting the TAB key, bash will fill in the rest for you. Even if you haven't typed in enough text to uniquely identify a filename, the shell will fill in as much as it can for you. Hitting TAB a second time will make it display a list of all possible matches for you.
One of the defining features of Linux and other UNIX-like operating systems is the number of small, relatively simple applications and the ability to stack them together to create complex systems. This is achieved by redirecting the output of one program to another, or by drawing input from a file or second program.
To get started, we're going to show you how to redirect the output of a program to a file. This is easily done with the '>' character. When bash sees the '>' character, it redirects all of the standard output (also known as stdout) to whatever file name follows.
darkstar:~$
echo foo
foodarkstar:~$
echo foo > /tmp/bar
darkstar:~$
cat /tmp/bar
foo
In this example, we show you what echo would
do if its stdout was not redirected to a file, then we re-direct it to
the /tmp/bar
file. If /tmp/bar
does not exist, it is created and the output from
echo is placed within it. If
/tmp/bar
did exist, then its contents are
over-written. This might not be the best idea if you want to keep
those contents in place. Thankfully, bash
supports '>>' which will append the output to the file.
darkstar:~$
echo foo
foodarkstar:~$
echo foo > /tmp/bar
darkstar:~$
cat /tmp/bar
foodarkstar:~$
echo foo2 >> /tmp/bar
darkstar:~$
cat /tmp/bar
foo foo2
You can also re-direct the standard error (or stderr) to a file. This is slightly different in that you must use '2>' instead of just '>'. (Since bash can re-direct input, stdout, and stderr, each must be uniquely identifiable. 0 is input, 1 is stdout, and 2 is stderr. Unless one of these is specified, bash will make its best guess as to what you actually meant, and assumed anytime you use '>' you only want to redirect stdout. 1> would have worked just as well.)
darkstar:~$
rm bar
rm: cannot remove `bar': No such file or directorydarkstar:~$
rm bar 2> /tmp/foo
darkstar:~$
cat /tmp/foo
rm: cannot remove `bar': No such file or directory
You may also redirect the standard input (known as stdin) with the '<' character, though it's not used very often.
darkstar:~$
fromdos < dosfile
Finally, you can actually redirect the output of one program as input to another. This is perhaps the most useful feature of bash and other shells, and is accomplished using the '|' character. (This character is referred to as 'pipe'. If you here some one talk of piping one program to another, this is exactly what they mean.)
darkstar:~$
ps auxw | grep getty
root 2632 0.0 0.0 1656 532 tty2 Ss+ Feb21 0:00 /sbin/agetty 38400 tty2 linux root 3199 0.0 0.0 1656 528 tty3 Ss+ Feb15 0:00 /sbin/agetty 38400 tty3 linux root 3200 0.0 0.0 1656 532 tty4 Ss+ Feb15 0:00 /sbin/agetty 38400 tty4 linux root 3201 0.0 0.0 1656 532 tty5 Ss+ Feb15 0:00 /sbin/agetty 38400 tty5 linux root 3202 0.0 0.0 1660 536 tty6 Ss+ Feb15 0:00 /sbin/agetty 38400 tty6 linux
Slackware Linux and other UNIX-like operating systems allow users to interact with them in many ways, but the most common, and arguably the most useful, is the terminal. In the old days, terminals were keyboards and monitors (sometimes even mice) wired into a mainframe or server via serial connections. Today however, most terminals are virtual; that is, they exist only in software. Virtual terminals allow users to connect to the computer without requiring expensive and often incompatabile hardware. Rather, a user needs only to run the software and they are presented with a (usually) highly customizable virtual terminal.
The most common virtual terminals (in that every Slackware Linux machine is going to have at least one) are the gettys. agetty(8) runs six instances by default on Slackware, and allows local users (those who can physically sit down in front of the computer and type at the keyboard) to login and run applications. Each of these gettys is available on different tty devices that are accessible seperately by pressing the ALT key and one of the function keys from F1 through F6. Using these gettys allows you to login multiple times, perhaps as different users, and run applications in those users' shells silmutaneously. This is most commonly done with servers which do not have X installed, but can be done on any machine.
On desktops, laptops, and other workstations where the user prefers a graphical interface provided by X, most terminals are graphical. Slackware includes many different graphical terminals, but the most commonly used are KDE's konsole and XFCE's Terminal(1) as well as the old standby, xterm(1). If you are using a graphical interface, check your tool bars or menus. Each desktop environment or window manager has a virtual terminal (often called a terminal emulater), and they are all labelled differently. Typically though, you will find them under a "System" sub-menu in desktop environments. Executing any of these will give you a graphical terminal and automatically run your default shell.
By now you should be pretty familiar with bash and you may have even noticed some odd behavior. For example, when you login at the console, you're presented with a prompt that looks a bit like this.
alan@darkstar:~$
However, sometimes you'll see a much less helpful prompt like this one.
bash-3.1$
The cause here is a special environment variable that controls the
bash prompt. Some shells are considered
"login" shells and others are "interactive" shells, and both types read
different configuration files when started. Login shells read
/etc/profile
and
~/.bash_profile
when executed. Interactive shells
read ~/.bashrc
instead. This has some advantages
for power users, but is a common annoyance for many new users who want
the same environment anytime they execute
bash and don't care about the difference
between login and interactive shells. If this applies to you, simply
edit your own ~/.bashrc file and include the following lines.
(For more information on
the different configuration files used, read the INVOCATION section of
the bash man page.)
# ~/.bashrc . /etc/profile . ~/.bash_profile
When using the above, all your login and interactive shells will have
the same environment settings and behave identically. Now, anytime we
wish to customize a shell setting, we only have to edit
~/.bash_profile
for user-specific changes and
/etc/profile
for global settings. Let's start by
configuring the prompt.
bash prompts come in all shapes, colors, and sizes, and every user has their own preferances. Personally, I prefer short and simple prompts that take up a minimum of space, but I've seen and used mutli-line prompts many times. One personal friend of mine even included ASCII-art in his bash prompt. To change your prompt you need only to change your PS1 variable. By default, Slackware attempts to configure your PS1 variable thusly:
darkstar:~$
echo $PS1
\u@\h:\w\$
Yes, this tiny piece of funny-looking figures controls your bash prompt. Basicaly, every character in the PS1 variable is included in the prompt, unless it is a escaped by a \, which tells bash to interpret it. There are many different escape sequences and we can't discuss them all, but I'll explain these. The first "\u" translates to the username of the current user. "\h" is the hostname of the machine the terminal is attached to. "\w" is the current working directory, and "\$" displays either a # or a $ sign, depending on whether or not the current user is root. A complete listing of all prompt escape sequences is listed in the bash man page under the PROMPTING section.
Since we've gone through all this trouble to discuss the default prompt, I thought I'd take some time to show you a couple example prompts and the PS1 variable values needed to use them.
Wed Jan 14 12:08 AM alan@raven:~$
echo $PS1 \d \@\n\u@\h:\w$HOST: raven - JOBS: 0 - TTY: 3 alan@~/Desktop/sb_3.0:$
echo $PS1 HOST: \H - JOBS: \j - TTY: \l\n\u@\w:\$
For even more information on configuring your bash prompt, including
information on setting up colored prompts, refer to
/usr/doc/Linux-HOWTOs/Bash-Prompt-HOWTO
. After
reading that for a short while, you'll get an idea of just how powerful
your bash prompts can be. I once even had a
prompt that gave me up to date weather information such as temperature
and barometric pressure!
Table of Contents
Eons ago computer terminals came with a screen and a keyboard and not much else. Mice hadn't come into common use and everything was menu driven. Then came the Graphical User Interface (GUI) and the world was changed. Today users are accustomed to moving a mouse around a screen, clicking on icons and running tasks with fancy images and animation, but UNIX systems predated this and so GUIs were added almost as an afterthought. For many years, Linux and its UNIX brethren were primarily used without graphics of any sort, but today it is perhaps more common than not for users to prefer their Linux computers come with shiney, flashy, clickable GUIs, and all these GUIs run on X(7).
So what is X? Is it the desktop with the icons? Is it the menus? Is it the window manager? Does it mark the spot? The answer to all these is a resounding "no". There are many parts to a GUI, but X is the most fundamental. X is that application that receives input from the mouse, keyboard, and possibly other devices. X is that application that tells the graphics card what to do. In short, X is the application that talks to your computer's hardware from graphical purposes; all other graphical applications simply talk to X.
Let's stop for a moment and talk about nomenclature. X is just one of a dozen names that you may encounter. It is also called X11, the X Window System, X Window, X11R6, X Version 11, and several others. Whatever you hear it called, simply understand that the speakers are referring to X.
As powerful as Slackware Linux is, configuring X can be daunting and is often one of the first real challenges a new user faces. Don't be overly concerned if you find this a bit difficult. While many changes have been made over the years that make this much easier, there are still computers out there that don't properly auto-detect, or you'll wish to make some change to some setting and it might not be immediately apparent what to do. Just remember that when I started using X, it was far more primitive than it is today, took far more work to configure, and often crashed without telling the user what was wrong. If I and thousands of others got this working back then, you can do it today. Fortunately, Slackware includes a default configuration file that works for most computers by using the VESA standard. This offers only the most basic functions and may not allow your graphics card to operate at its full potential. You may be limited to low resolutions, fewer colors, and X will be slower. Still, this is an option for users, particularly those who only want to occassionally run X. You can try it out now simply by running startx(1) from a command prompt.
There are many ways to configure X, but the easiest is to use xorgsetup. This will attempt to probe probe your computer's hardware and write a working xorg.conf file. This option is not garaunteed to work; there are some platforms that it is known not to work with, and there are probably others as well. Still, it is worth trying first as it is the quickest and least complicated for a new user to attempt.
The second most popular way to configure X on your system is the handy xorgconfig(1). This application asks you a series of questions about your computer's hardware and writes out a config file based on your choices. Unless you know exactly what your hardware is, we recommend that you try xorgsetup first.
Lastly, you can manually configure your X
server by modifying /etc/X11/xorg.conf
with a text
editor. This is not normally a task for the faint of heart, but is
often the easiest way to make minor changes.
Slackware Linux includes many different window managers and desktop environments. Window managers are the applications responsible for painting application windows on the screen, resizing these windows, and similar tasks. Desktop environments include a window manager, but also add task bars, menus, icons, and more. Slackware includes both the KDE and XFCE desktop environments and several additional window managers. Which you use is entirely your own decision, but in general, window managers tend to be faster than desktop environments and more suitable to older systems with less memory and slower processors. Desktop environments will be more comfortable for users accustomed to Microsoft Windows.
LIST OF DE'S AND WINDOW MANAGERS. FILL THIS IN!!!! FILL THIS IN!!!! FILL THIS IN!!!! FILL THIS IN!!!! FILL THIS IN!!!! FILL THIS IN!!!! FILL THIS IN!!!! FILL THIS IN!!!! FILL THIS IN!!!! FILL THIS IN!!!! FILL THIS IN!!!! FILL THIS IN!!!!
The easiest way to choose a window manager is xwmconfig(1), included with Slackware Linux. This application allows a user to choose what window manager to run with startx.
By default, when you boot your Slackware Linux system you are presented with a login prompt on a virtual terminal. This is more than adequate for most people's needs. If you need to run commandline applications, you may login and do so right away. If you want to run X, simply executing startx will do that for you nicely. But suppose you almost exclusively use your system for graphical duties like many laptop owners? Wouldn't it be nice for Slackware to take you straight into a GUI? Fortunately, there's an easy way to do just that.
Slackware uses the System V init system which allows the administrator to boot into or change to different runlevels, which are really just different "states" the computer can be in. In fact, shutting down the computer is really only a case of changing to a runlevel which accomplishes just that. Runlevels can be rather complicated, so we won't delve into them any further than necessary.
Runlevels are configured in inittab
(5).
The most common ones are
runlevel 3 (Slackware's default) and runlevel 4 (GUI). In order to tell
Slackware to boot to a GUI screen, simply open
/etc/inittab
with your
favorite editor of choice. (You may wish to refer to one of the
chapters on vi or
emacs at this point.) Near the top, you'll
see the relevant entries.
# These are the default runlevels in Slackware: # 0 = halt # 1 = single user mode # 2 = unused (but configured the same as runlevel 3) # 3 = multiuser mode (default Slackware runlevel) # 4 = X11 with KDM/GDM/XDM (session managers) # 5 = unused (but configured the same as runlevel 3) # 6 = reboot # Default runlevel. (Do not set to 0 or 6) id:3:initdefault:
In this file (along with most configuration files) anything following a hash symbol # is a comment and not interpreted by init(8). Don't worry if you don't understand everything about inittab, as many veteran users don't either. The only line we are interested in is the last on above. Simply change the 3 to a 4 and reboot.
# These are the default runlevels in Slackware: # 0 = halt # 1 = single user mode # 2 = unused (but configured the same as runlevel 3) # 3 = multiuser mode (default Slackware runlevel) # 4 = X11 with KDM/GDM/XDM (session managers) # 5 = unused (but configured the same as runlevel 3) # 6 = reboot # Default runlevel. (Do not set to 0 or 6) id:4:initdefault:
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Table of Contents
Slackware Linux inherits a strong multi-user tradition from its UNIX inspiration. This means that multiple people may use the system at once, but it also means that each of these people may have different permissions. This allows users to prevent others from modifying their files, or lets system administrators explicitly define what users can and cannot do on the system. Moreover, users need not be actual people at all. In fact, Slackware includes several dozen pre-defined user and group accounts that are not typically used by regular users. Rather these accounts allow the system administrator to segment the system for security reasons. We'll see how that's done in the next chapter on filesystem permissions.
The easiest way to add new users in Slackware is through the use of our very fine adduser shell script. adduser will prompt you to enter the details of the new user you wish to creature and step you through the process quickly and easily. It will even create a password for the new user.
darkstar:~#
adduser
Login name for new user []:david
User ID ('UID') [ defaults to next available ]: Initial group [ users ]: Additional UNIX groups: Users can belong to additional UNIX groups on the system. For local users using graphical desktop login managers such as XDM/KDM, users may need to be members of additional groups to access the full functionality of removable media devices. * Security implications * Please be aware that by adding users to additional groups may potentially give access to the removable media of other users. If you are creating a new user for remote shell access only, users do not need to belong to any additional groups as standard, so you may press ENTER at the next prompt. Press ENTER to continue without adding any additional groups Or press the UP arrow to add/select/edit additional groups :audio cdrom floppy plugdev video
Home directory [ /home/david ] Shell [ /bin/bash ] Expiry date (YYYY-MM-DD) []: New account will be created as follows: --------------------------------------- Login name.......: david UID..............: [ Next available ] Initial group....: users Additional groups: audio,cdrom,floppy,plugdev,video Home directory...: /home/david Shell............: /bin/bash Expiry date......: [ Never ] This is it... if you want to bail out, hit Control-C. Otherwise, press ENTER to go ahead and make the account. Creating new account... Changing the user information for david Enter the new value, or press ENTER for the default Full Name []: Room Number []: Work Phone []: Home Phone []: Other []: Changing password for david Enter the new password (minimum of 5, maximum of 127 characters) Please use a combination of upper and lower case letters and numbers. New password: Re-enter new password: Password changed. Account setup complete.
The addition of optional groups needs a little explaining. Every user in Slackware has a single group that it is always a member of. By default, this is the "users" group. However, users can belong to more than one group at a time and will inherit all the permissions of every group they belong to. Typical desktop users will need to add several group memberships in order to do things like play sound or access removeable media like cdroms or USB flash drives. You can simply press the up arrow key at this section and a list of default groups for desktop users will magically appear. You can of course, add to or remove groups from this listing.
Now that we've demonstrated how to use the interactive adduser program, lets look at some powerful non-interactive tools that you may wish to use. The first is useradd(8). useradd is a little less friendly, but much faster for creating users in batches. This makes it ideal for use in shell scripts. In fact, adduser is just such a shell script and uses useradd for most of the heavy lifting. useradd has many options and we can't explain them all here, so refer to its man page for the complete details. Now, let's make a new user.
darkstar:~#
useradd -d /data/home/alan -s /bin/bash -g users -G audio,cdrom,floppy,plugdev,video alan
Here I have added the user "alan". I specified the user's home
directory as /data/home/alan
and used
bash as my shell. Also, I specified my
default group as "users" and added myself to a number of useful groups
for dekstop use. You'll note that useradd
does not do any prompting like adduser.
Unless you want to accept the defaults for everything, you'll need to
tell useradd what to do.
Now that we know how to add users, we should learn how to add groups. As you might have guessed, the command for doing this is groupadd(8). groupadd works in the same way as useradd, but with far fewer options. The following command adds the group "slackers" to the system.
darkstar:~#
groupadd slackers
Deleting users and groups is easy as well. Simply run the userdel(8) and groupdel(8) commands. By default, userdel will leave the user's home directory on the system. You can remove this with the [-r] argument.
Several other tools exist for managing users and groups. Perhaps the most important one is passwd(1). This command changes a user account's password. Normal users may change their own passwords only, but root can change anyone's password. Also, root can lock a user account with the [-l] argument. This doesn't actually shutout the account, but instead changes the user's encrypted password to a value that can't be matched.
Another useful tool is chsh(1) which changes a user's default shell. Like passwd, normal users can only change their own shell, but the root user can change anyone's.
The last tool we're going to discuss is
chfn(1). This is used to enter identifying
information on the user such as his phone number and real name. This
information is stored in the passwd
(5) file and
retrieved using finger(1).
Like most things in Slackware Linux, users and groups are stored in plain-text files. This means that you can edit all the details of a user, or even create a new user or group simply by editing these files and doing a few other tasks like creating the user's home directory. Of course, after you see how this is done you'll appreciate just how simple the included tools make this task.
Our first stop is the /etc/passwd
file. Here, all
the information about a user is stored, except for (oddly enough) the
user's password. The reason for this is rather simple.
/etc/passwd
must be readable by all users on the
system, so you wouldn't want passwords stored there, even if they are
encrypted. Let's take a quick look at my entry in this file.
alan:x:1000:100:,,,:/home/alan:/bin/bash
Each line in this file contains a number of fields seperated by a
colon. They are, from left to right: username, password, UID, GUID, a
comment field, home directory, and shell. You'll notice that the
password field for every entry is an x. That is
because Slackware uses shadow passwords, so the actual encrypted
password is stored in /etc/shadow
. Let's take a
look there.
alan:$1$HlR?M3fkL@oeJmsdLfhsLFM*4dflPh8:14197:0:99999:7:::
The shadow
file contains more than just the
encrypted password as you'll notice. The fields here, again from left
to right, are: username, encrypted password, last day the password was
changed, days before the password may be changed again, how many days
before the password expires, days that the account will be disabled
after expiring, when the account was disabled, and a reserved field.
You may notice on some accounts that the various "days" fields often
include very large numbers. The reason for this is that Slackware
counts time from the "Epoch" which is January 1, 1970 for historical
reasons.
To create a new user account, you'll just need to open these files
using vipw(8). This will open
/etc/passwd
in the editor
defined by your VISUAL variable or your EDITOR variable if VISUAL isn't
defined. If neither is present, it will fall back to
vi by default. If you pass the [-s]
argument, it will open /etc/shadow
instead. It's
important to use vipw instead of using any
other editor, because vipw will lock the
file and prevent other programs from editing it right underneath your feet.
That isn't all you'll need to do however; you must also create the user's home directory and change the user's password using passwd.
As we've discussed, Slackware Linux is a multi-user operating system. Because of this, its filesystems are mutli-user as well. This means that every file or directory has a set of permissions that can grant or deny privileges to different users. There are three basic permissions and three sets of permissions for each file. Let's take a look at an example file.
darkstar:~$
ls -l /bin/ls
-rwxr-xr-x 1 root root 81820 2007-06-08 21:12 /bin/ls
Recall from chapter 4 that ls [-l] lists the permissions for a file or directory along with the user and group that "own" the file. In this case, the permissions are rwxr-xr-x, the user is root and the group is also root. The permissions section, while grouped together, is really three seperate pieces. The first set of three letters are the permissions granted to the user that owns the file. The second set of three are those granted to the group owner, and the final three are permissions for everyone else.
Table 9.1. Permissions of /bin/ls
Set | Listing | Meaning |
---|---|---|
Owner | rwx | The owner "root" may read, write, and execute |
Group | r-x | The group "root" may read and execute |
Others | r-x | Everyone else may read and execute |
The permissions are pretty self explainatory of course, at least for files. Read, write, and execute allow you to read a file, write to it, or execute it. But what do these permissions mean for directories? Simply put, the read permissions grants the ability to list the directory's contents (say with ls). The write permission grants the ability to create new files in the directory as well as delete the entire directory, even if you otherwise wouldn't be able to delete some of the other files inside it. The execute permission grants the ability to actually enter the directory (with the bash built-in command cd for example).
Let's look at the permissions on a directory now.
darkstar:~$
ls -ld /home/alan
drwxr-x--- 60 alan users 3040 2008-06-06 17:14 /home/alan/
Here we see the permissions on my home directory and its ownership. The directory is owned by the user alan and the group users. The user is granted all rights (rwx), the group is granted only read and execute permissions (r-x), and everyone else is prohibited from doing anything.
So now that we know what permissions are, how do we change them? And for that matter, how do we assign user and group ownership? The answer is right here in this section.
The first tool we'll discuss is the useful chown (1) command. Using chown, we can (you guessed it), change the ownership of a file or directory. chown is historically used only to change the user ownership, but can change the group ownership as well.
darkstar:~#
ls -l /tmp/foo
total 0 -rw-r--r-- 1 alan users 0 2008-06-06 22:29 a -rw-r--r-- 1 alan users 0 2008-06-06 22:29 bdarkstar:~#
chown root /tmp/foo/a
darkstar:~#
ls -l /tmp/foo
total 0 -rw-r--r-- 1 root users 0 2008-06-06 22:29 a -rw-r--r-- 1 alan users 0 2008-06-06 22:29 b
By using a colon after the user account, you may also specify a new group account.
darkstar:~#
chown root:root /tmp/foo/b
darkstar:~#
ls -l /tmp/foo
total 0 -rw-r--r-- 1 root users 0 2008-06-06 22:29 a -rw-r--r-- 1 root root 0 2008-06-06 22:29 b
chown can also be used recursively to change
the ownership of all files and directories below a target directory.
The following command would change all the files under the directory
/tmp/foo
to have their ownership set to root:root.
darkstar:~#
chown -R root:root /tmp/foo/b
Specifying a colon and a group name without a user name will simply change the group for a file and leave the user ownership intact.
darkstar:~#
chown :wheel /tmp/foo/a
darkstar:~#
ls -l /tmp/foo
ls -l /tmp/foo total 0 -rw-r--r-- 1 root wheel 0 2008-06-06 22:29 a -rw-r--r-- 1 root root 0 2008-06-06 22:29 b
The younger brother of chown is the slightly less useful chgrp(1). This command works just like chown, except it can only change the group ownership of a file. Since chown can already do this, why bother with chgrp? The answer is simple. Many other operating systems use a different version of chown that cannot change the group ownership, so if you ever come across one of those, now you know how.
There's a reason we discussed changing ownership before changing permissions. The first is a much easier concept to grasp. The tool for changing permissions on a file or directory is chmod(1). The syntax for it is nearly identical to that for chown, but rather than specify a user or group, the administrator must specify either a set of octal permissions or a set of alphabetic permissions. Neither one is especially easy to grasp the first time. We'll begin with the less complicated octal permissions.
Octal permissions derive their name from being assigned by one of eight digits, namely the numbers 0 through 7. Each permissions is assigned a number that is a power of 2, and those numbers are added together to get the final permissions for one of the permission sets. If this sounds confusing, maybe this table will help.
By adding these values together, we can reach any number between 0 and 7 and specify all possible permission combinations. For example, to grant both read and write privilages while denying execute, we would use the number 6. The number 3 would grant write and execute permissions, but deny the ability to read the file. We must specify a number for each of the three sets when using octal permissions. It's not possible to specify only a set of user or group permissions this way for example.
darkstar:~#
ls -l /tmp/foo/a
-rw-r--r-- 1 root root 0 2008-06-06 22:29 adarkstar:~#
chmod 750 /tmp/foo/a
darkstar:~#
ls -l /tmp/foo/a
-rwxr-x--- 1 root root 0 2008-06-06 22:29 a
chmod can also use letter values along with + or - to grant or deny permissions. While this may be easier to remember, it's often easier to use the octal permissions.
To use the letter values with chmod, you must specify which set to use them with, either "u" for user, "g" for group, and "o" for all others. You must also specify whether you are adding or removing permissions with the "+" and "-" signs. Multiple sets can be changed at once by seperating each with a comma.
darkstar:/tmp/foo#
ls -l
total 0 -rw-r--r-- 1 alan users 0 2008-06-06 23:37 a -rw-r--r-- 1 alan users 0 2008-06-06 23:37 b -rw-r--r-- 1 alan users 0 2008-06-06 23:37 c -rw-r--r-- 1 alan users 0 2008-06-06 23:37 ddarkstar:/tmp/foo#
chmod u+x a
darkstar:/tmp/foo#
chmod g+w b
darkstar:/tmp/foo#
chmod u+x,g+x,o-r c
darkstar:/tmp/foo#
chmod u+rx-w,g+r,o-r d
darkstar:/tmp/foo#
ls -l
-rwxr--r-- 1 alan users 0 2008-06-06 23:37 a* -rw-rw-r-- 1 alan users 0 2008-06-06 23:37 b -rwxr-x--- 1 alan users 0 2008-06-06 23:37 c* -r-xr----- 1 alan users 0 2008-06-06 23:37 d*
Which you prefer to use is entirely up to you. There are places where one is better than the other, so a real Slacker will know both inside out.
We're not quite done with permissions just yet. There are three other "special" permissions in addition to those mentioned above. They are SUID, SGID, and the sticky bit. When a file has one or more of these permissions set, it behaves in special ways. The SUID and SGID permissions change the way an application is run, while the sticky bit restricts deletion of files. These permissions are applied with chmod like read, write, and execute, but with a twist.
SUID and SGID stand for "Set User ID" and "Set Group ID" respectively. When an application with one of these bits is set, the application runs with the user or group ownership permissions of that application regardless of what user actually executed it. Let's take a look at a common SUID application, the humble passwd and the files it modifies.
darkstar:~#
ls -l /usr/bin/passwd \ /etc/passwd \ /etc/shadow
-rw-r--r-- 1 root root 1106 2008-06-03 22:23 /etc/passwd -rw-r----- 1 root shadow 627 2008-06-03 22:22 /etc/shadow -rws--x--x 1 root root 34844 2008-03-24 16:11 /usr/bin/passwd*
Notice the permissions on passwd. Instead of
an x in the user's execute slot, we have an
s. This tells us that
passwd is a SUID program, and when we run
it, the process will run as the user "root" rather than as the user
that actually executed it. The reason for this is readily apparent as
soon as you look at the two files it modifies. Neither
/etc/passwd
nor /etc/shadow
are writeable by anyone other than root. Since users need to change
their personal information, passwd must be
run as root in order to modify those files.
So what about the sticky bit? The sticky bit restricts the ability to move or delete files and is only ever set on directories. Non-root users cannot move or delete any files under a directory with the sticky bit set unless they are the owner of that file. Normally anyone with write permission to the file can do this, but the sticky bit prevents it for anyone but the owner (and of course, root). Let's take a look at a common "sticky" directory.
darkstar:~#
ls -ld /tmp
drwxrwxrwt 1 root root 34844 2008-03-24 16:11 /tmp
Naturally, being a directory for the storage of temporary files sytem
wide, /tmp
needs to be readable, writeable, and
executable by anyone and everyone. Since any user is likely to have a
file or two stored here at any time, it only makes good sense to
prevent other users from deleting those files, so the sticky bit has
been set. You can see it by the presence of the t in
place of the x in the world permissions section.
Table 9.5. SUID, SGID, and "Sticky" Permissions
Permission Type | Octal Value | Letter Value |
---|---|---|
SUID | 4 | s |
SGID | 2 | s |
Sticky | 1 | t |
When using octal permissions, you must specify an additional leading
octal value. For example, to recreate the permission on
/tmp
, we would use 1777. To recreate those
permissions on /usr/bin/passwd
, we would use 4711.
Essentially, any time this leading fourth octet isn't specified,
chmod assumes its value to be 0.
darkstar:~#
chmod 1777 /tmp
darkstar:~#
chmod 4711 /usr/bin/passwd
Using the alphabetic permission values is slightly different. Assuming the two files above have permissions of 0000 (no permissions at all), here is how we would set them.
darkstar:~#
chmod ug+rwx,o+rwt /tmp
darkstar:~#
chmod u+rws,go+x /usr/bin/passwd
Table of Contents
Slackware Linux stores all of its files and directories under a single
/
directory, typically referred to as "root". This
is in stark contract to what you may be familiar with in the form of
Microsoft Windows. Different hard disk partitions, cdroms, usb flash
drives, and even floppy disks can all be mounted in directories under
/
, but do not have anything like "drive letters".
The contents of these devices can be found almost anywhere, but there
are some sane defaults that Slackware sets up for you. For example,
cd-rw drives are most often found at /mnt/cd-rw
.
Here are a few common directories present on nearly all Slackware Linux
installations, and what you can expect to find there.
Table 10.1. Filesystem Layout
/ | The root directory, under which all others exist |
/bin | Minimal set of binary programs for all users |
/boot | The kernel, initrd, and other requirements for booting Slackware |
/etc/ | System configuration files |
/dev | Collection of special files allowing direct access to hardware |
/home | User directories where personal files and settings are stored |
/media | Directory for auto-mounting features in DBUS/HAL |
/mnt | Places to temporarily mount removable media |
/opt | Directory where some (typicaly proprietary) software may be installed |
/proc | Kernel exported filesystem for process information |
/root | The root user's home directory |
/sbin | Minimal set of system or superuser binaries |
/srv | Site-specific data such as web pages served by this system |
/sys | Special kernel implimentation details |
/tmp | Directory reserved for temporary files for all users |
/usr | All non-essential programs, libraries, and shared files |
/var | Regularly changing data such as log files |
The Linux kernel supports a wide variety of filesystems, which allows you to choose from a long list of features to tailor to your particular need. Fortunately, most of the default filesystem types are adequate for any needs you may have. Some filesystems are geared towards particular media. For example, the iso9660 filesystem is used almost exclusively for CD and DVD media.
ext2 is the oldest filesystem included in Slackware Linux for storing data on hard disks. Compared to other filesystems, ext2 is simplistic. It is faster than most others for reading and writing data, but does not include any journaling capability. This means that after a hard crash, the filesystem must be exhaustively checked to discover and (hopefully) fix any errors.
ext3 is the younger cousin of ext2. It was designed to replace ext2 in most situations and shares much the same code-base, but adds journaling support. In fact, ext3 and ext2 are so much alike that it is possible to convert one to the other on the fly without lose of data. ext3 enjoys a lot of popularity for these reasons. There are many tools available for recovering data from this filesystem in the event of catastrophic hardware failure as well. ext3 is a good general purpose filesystem with journaling support, but fails to perform as well as other journaling filesystems in specific cases. One pitfall to ext3 is that the filesystem must still go through this exhaustive check every so often. This is done when the filesystem is mounted, usually when the computer is booted, and causes an annoying delay.
reiserfs is one of the oldest journaling filesystems for the Linux kernel and has been supported by Slackware for many years. It is a very fast filesystem particularly well suited for storing, retrieving, and writing lots of small files. Unfortunately there are few tools for recovering data should you experience a drive failure, and reiserfs partitions experience corruption more often than ext3.
XFS was contributed to the Linux kernel by SGI and is one of the best filesystems for working with large volumes and large files. XFS uses more RAM than other filesystems, but if you need to work with large files its performance there is well worth the penalty in memory usage. XFS is not particularly ill-suited for desktop or laptop use, but really shines on a server that handles medium to large size files all day long. Like ext3, XFS is a fully journaled filesystem.
JFS was contributed to the Linux kernel by IBM and is well known for its responsiveness even under extreme conditions. It can span colossal volumes making it particularly well-suited for Network Attached Storage (NAS) devices. JFS's long history and thorough testing make it one of the most reliable journaling filesystems available for Linux.
iso9660 is a filesystem specifically designed for optical media such as CDs and DVDs. Since optical disks are read-only media, the linux kernel does not even include write support for this filesystem. In order to create an iso9660 filesystem, you must use user-land tools like mkisofs(8) or growisofs(8).
Sometimes you may need to share data between Windows and Linux computers, but can't transfer the files over a network. Instead you require a shared hard drive partition or a USB flash drive. The humble vfat filesystem is the best choice here since it is supported by the largest variety of operating systems. Unfortuantely, being a Microsoft designed filesystem, it does not store permissions in the same way as traditional Linux filesystems. This means that special options must be used to allow multiple users to access data on this filesystem.
Unlike other filesystems which hold files and directories, swap partitions hold virtual memory. This is very useful as it prevents the system from crashing should all your RAM be consumed. Instead, the kernel copies portions of the RAM into swap and frees them up for other applications to use. Think of it as adding virtual memory to your computer, very slow virtual memory. swap is typically a fail-safe and shouldn't be relied upon for continual use. Add more RAM to your system if you find yourself using lots of swap.
Now that we've learned what (some of) the different filesystems
available in Linux are, it's time we looked at how to use them. In
order to read or write data on a filesystem, that filesystem must first
be mounted. To do this, we (naturally) use
mount(8). The first thing we must do is
decide where we want the filesystem located. Recall that there are no
such things are drive letters denoting filesystems in Linux. Instead,
all filesystems are mounted on directories. The base filesystem on
which you install Slackware is always located at /
and others are always located in subdirectories of
/
. /mnt/hd
is a common place
to temporarily locate a partition, so we'll use that in our first
example. In order to mount a filesystem's contents, we must tell mount
what kind of filesystem we have, where to mount it, and any special
options to use.
darkstar:~#
mount -t ext3 /dev/hda3 /mnt/hd -o ro
Let's disect this. We have an ext3 filesystem located on the third
partition of the first IDE device, and we've decided to mount its
contents on the directory /mnt/hd
. Additionally,
we have mounted it read-only so no changes can be made to these
contents. The [-t ext3] argument tells
mount
what type of filesystem we are using,
in this case it is ext3. This lets the kernel know which driver to use.
Often mount can determine this for itself,
but it never hurts to explicitly declare it. Second, we tell
mount
where to locate the filesystem's contents. Here we've chosen
/mnt/hd
.
Finally, we must decide what options to use if any. These are declared
with the [-o] argument. A short-list of the most common
options follows.
Table 10.2. Common mount options
ro | read-only |
rw | read-write (default) |
uid | user to own the contents of the filesystem |
gid | group to own the contents of the filesystem |
noexec | prevent execution of any files on the filesystem |
defaults | sane defaults for most filesystems |
If this is your first Linux installation, the only options you typically need to be concerned about are [ro] and [rw]. The exception to this rule comes when you are dealing with filesystems that don't handle traditional Linux permissions such as vfat or NTFS. In those cases you'll need to use the [uid] or [gid] options to allow non-root users access to these filesystems.
darkstar:~#
mount -t vfat /dev/hda4 /mnt/hd -o uid=alan
But Alan, that's appalling! I don't want to have to tell mount what
filesystem or options to use everytime I load a CD. It should be easier
than that. Well thankfully, it is. The /etc/fstab
file contains all this information for filesystems that the installer
sets up for you, and you can make additions to it as well.
fstab
(5) looks like a simple table containing the
device to mount along with its filesystem type and optional arguments.
Let's take a look.
darkstar:~#
cat /etc/fstab
/dev/hda1 / reiserfs defaults 1 1 /dev/hda2 /home reiserfs defaults 1 2 /dev/hda3 swap swap defaults 0 0 /dev/cdrom /mnt/cdrom auto noauto,owner,ro,users 0 0 /dev/fd0 /mnt/floppy auto noauto,owner 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 proc /proc proc defaults 0 0
If you have an entry in fstab
for your filesystem, you
need only tell mount the device node or the mount location.
darkstar:~#
mount /dev/cdrom
darkstar:~#
mount /home
One final use for mount is to tell you what filesystems are currently mounted and with what options. Simply run mount without any arguments to display these.
In addition to local filesystems, Slackware supports a number of network filesystems as both client and server. This allows you to share data between multiple computers transparently. We'll discuss the two most common: NFS and SMB.
NFS is the Network File System for Linux as well as several other common
operating systems. It has modest performance but supports the full range of
permissions for Slackware. In order to use NFS as either a client or a
server, you must run the remote procedure call daemon. This is easily
accomplished by setting the /etc/rc.d/rc.rpc
file
executable and telling it to start. Once it has been set executable, it
will run automatically every time you boot into Slackware.
darkstar:~#
chmod +x /etc/rc.d/rc.rpc
darkstar:~#
/etc/rc.d/rc.rpc start
Mounting an NFS share is little different than mounting a local filesystem. Rather than specifying a local device, you must tell mount the domain name or IP address of the NFS server and the directory to mount with a colon between them.
darkstar:~#
mount -t nfs darkstar.example.com:/home /home
Running an NFS server is a little bit different. First, you must configure
each directory to be exported in the /etc/exports
file. exports
(5) contains information about what
directories will be shared, who they will be shared with, and what special
permissions to grant or deny.
# See exports(5) for a description. # This file contains a list of all directories exported to other computers. # It is used by rpc.nfsd and rpc.mountd. /home/backup 192.168.1.0/24(sync,rw,no_root_squash)
The first column in
exports
is a list of the files to be exported via NFS. The second column is a list
of what systems may access the export along with special permissions. You
can specify hosts via domain name, IP address, or netblock address (as I
have here). Special permissions are always a parenthetical list. For a
complete list, you'll need to read the man page. For now, the only special
option that matters is [no_root_squash]. Usually the root user on
an NFS client cannot read or write an exported share. Instead, the root
user is "squashed" and forced to act as the nobody user.
[no_root_squash] prevents this.
You'll also need to run the NFS daemon. Starting and stopping NFS server
support is done with the /etc/rc.d/rc.nfsd
rc script.
Set it executable and run it just like we did for
rc.rpc
and you are ready to go.
SMB is the Windows network file-sharing protocol. Connecting to SMB shares
(commonly called samba shares) is fairly straight forward. Unfortuantely,
SMB isn't as strongly supported as NFS. Still, it offers higher performance
and connectivity with Windows computers. For these reasons, SMB is the most
common network file-sharing protocol deployed on local networks. Exporting
SMB shares from Slackware is done through the samba daemon and configured
in smb.conf
(5). Unfortunately configuring samba as a
service is beyond the scope of this book. Check online for additional
documentation, and as always refer to the man page.
Thankfully mounting an SMB share is easy and works almost exactly like mounting an NFS share. You must tell mount where to find the server and what share you wish to access in exactly the same way. Additionally, you must specify a username and password.
darkstar:~#
mount -t cifs //darkstar/home /home -o username=alan,password=secret
You may be wondering why the filesystem type is cifs instead of smbfs. In older versions of the Linux kernel, smbfs was used. This has been deprecated in favor of the better performing and more secure general purpose cifs driver.
All SMB shares require the [username] and [password] arguments. This can create a security problem if you wish to place your samba share in fstab. You may avoid this problem by using the [credentials] argument. [credentials] points to a file which contains the username and password information. As long as this file is safely guarded and readable only by root, the likelyhood that your authentication credentials will be compromised is lessened.
darkstar:~#
echo "username=alan" > /etc/creds-home
darkstar:~#
echo "password=secret" >> /etc/creds-home
darkstar:~#
mount -t cifs //darkstar/home -o credentials=/etc/creds-home
Table of Contents
Scattered all around your computer are thousands of text files. To a new user, this may seem inconsequential, but almost everything in Slackware Linux uses a plain-text file for configuration. This allows users to make changes to the system quickly, easily, and intuitively. In chapter 5, we looked at a few commands such as cat and less that can be used to read these files, but what if we want to make changes to them? For that, we need a text editor, and vi is up to the task.
In short, vi is one of the oldest and most powerful text editors still used today. It's beloved by system administrators, programmers, hobbiests, and others the world over. In fact, nearly this entire book was written using vi; only the next chapter on emacs was written with that editor.
A little further explanation is needed to learn exactly what
vi is today though, as Slackware Linux
technically doesn't include vi. Rather,
Slackware includes two vi "clones", elvis(1)
and vim(1). These clones add many additional
features to vi such as syntax highlighting, binary editing modes, and
network support. We won't go too deeply into all these details. By
default, if you execute vi on Slackware
Linux, you'll be using elvis, so all
examples in this chapter will assume that is what you are using. If
you've used another Linux distribution before, you may be more familiar
with vim. If so, you might wish to change
the symlink for /usr/bin/vi
to point to
/usr/bin/vim
, or add an alias to your shell's
startup scripts. vim is generally considered
to be more feature-rich than elvis, but
elvis is a much smaller program and contains
more features than most users will ever need.
vi is very powerful, but also somewhat cumbersome and challening for a new user to learn. However, mastering vi is an important skill for any self-respecting system administrator to learn, as vi is included on nearly every Linux distribution, every BSD system, and every UNIX system in existance. It's even included in Mac OS X. Once you've learned vi, you'll not have to learn another text editor to work on any of these systems. In fact, vi clones have even been ported to Microsoft Windows systems, so you can use it there too.
New users are often frustrated when using vi for the first time. When invoked without any arguments, vi will display a screen something like this.
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Command
At this point, the user will being typing and expect the keys he presses to appear in the document. Instead, something really strange happens. The reason for this is simple. vi has different operation "modes". There is a command mode and an insert mode. Command mode is the default; in this mode, each keystroke performs a particular action such as moving the cursor around, deleting text, yanking (copying) text, searching, etc.
Ok, so you've decided that you want to learn how to use
vi. The first thing to do is learn how to
open and save files. Opening files is actually pretty easy. Simply type
the filename as an argument on the command-line and
vi will happily load it for you. For
example, vi chapter_11.xml
will open the file
chapter_11.xml
and load its content onto the
screen, simple enough. But what if we've finished with one document and
wish to save it? We can do that in command mode using the [:w]
command. When in command mode, pressing the : key
temporarily positions the cursor on the very bottom line of the window
and allows you to enter special commands. (This is technically known as
ex-mode after the venerable ex application
which we will not document here.) The command to save your current work
is [:w]. Once this is done, vi will
write your changes to the buffer back into the file. If you wish to
open another document, simply use the [:e other_document]
command and vi will happily open it for you.
If you've made changes to the buffer but haven't saved it yet,
[:e] will fail and print a warning message on the bottom line.
You can bypass this with the [:e!] command. Most ex-mode
commands in vi can be "forced" by adding
! to them. This tells vi
that you want to abandon any changes you've made to the buffer and open
the other document immediately.
But what if I don't like my changes and want to quit or start over? That's easily done as well. Executing the [:e!] command without any arguments will re-open the current document from the beginning. Quitting vi is as simple as running the [:q] command if you haven't made any changes to the buffer, or [:q!] if you'd like to quit and abandon those changes.
Moving around in vi is perhaps the hardest thing for a new user to learn. vi does not traditionally use the directional arrow keys for cursor movement, although in Slackware Linux that is an option. Rather, movement is simply another command issued in command-mode. The reason for this is rather simple. vi actually predates the inclusion of directional arrow keys on keyboards. Thus, movement of the cursor had to be accomplished by using the few keys available, so the right-hand "home row" keys of h, j, k, and l were chosen. These keys will move the cursor about whenever vi is in command mode. Here's a short table to help you remember how they work.
Table 11.1. vi cursor movement
Command | Result |
---|---|
h | Move the cursor one character left. |
j | Move the cursor one line down |
k | Move the cursor one line up |
l | Move the cursor one character right |
Moving around is a little more powerful than that though. Like many command keys, these movement keys accept numerical arguments. For example, 10j will move the cursor down 10 lines. You can also move to the end or beginning of the current line with $ and ^, respectively.
Now that we're able to open and save documents, as well as move around in them, it's time to learn how to edit them. The primary means of editing is to enter insert mode using either the i or a command keys. These either insert text at the cursor's current location, or append it after the cursor's current location. Once into insert mode, you can type any text normally and it will be placed into your document. You can return to command mode in order to save your changes by pressing the ESC key.
Since vi can be difficult to learn, I've prepared a short cheat sheat that should help you with the basics until you begin to feel comfortable.
Table 11.2. vi Cheat Sheet
Command | Result |
---|---|
h | Move the cursor one character left. |
j | Move the cursor one line down |
k | Move the cursor one line up |
l | Move the cursor one character right |
10j | Move the cursor ten lines down |
G | Move to the end of the file |
^ | Move to the beginning of the line |
$ | Move to the end of the line |
dd | Remove a line |
5dd | Remove 5 lines |
r | Replace a single character |
R | Replace multiple characters |
x | Delete a character |
X | Delete the previous character |
u | Undo the last action |
:s'old'new'g | Replace all occurances of 'old' with 'new' |
/asdf | Locate next occurance of asdf |
:q | Quit (without saving) |
:w | Save the current document |
:w file | Save the current document as 'file' |
:x | Save and quit |
Computers aren't very interesting on their own. Sure, you can install games on them, but that just turns them into glorified entertainment consoles. Today, computers need to be able to talk to one another; they need to be networked. Whether you're installing a business network with hundreds or thousands of computers or just setting up a single PC for Internet access, Slackware is simple and easy. This chapter should teach you how to setup typical wired networks. Common wireless setup will be thoroughly discussed in the next section, but much of what you read here will be applicable there as well.
There are many different ways to configure your computer to connect to a network or the Internet, but they fall into two main categories: static and dymanic. Static addresses are solid; they are set with the understanding that they will not be changed, at least not anytime soon. Dynamic addresses are fluid; the assumption is that the address will change at some time in the future. Typically any sort of network server requires a static address simply so other machines will know where to contact it when they need services. Dynamic addresses tend to be used for workstations, Internet clients, and any machine that doesn't require a static address for any reason. Dynamic addresses are more flexible, but present complications of their own.
There are many different kinds of network protocols that you might encounter, but most people will only ever need to deal with Internet Protocol (IP). For that reason, we'll focus exclusively on IP in this book.
Ok, so you've installed Slackware, you've setup a desktop, but you can't get it to connect to the Internet or your business's LAN (local area network), what do you do? Fortunately, the answer to that question is simple. Slackware includes a number of tools to configure your network connection. The first we will look at today is the very powerful ifconfig(8). ifconfig is used to setup or modify the configuration of a Network Interface Card (NIC or Ethernet Card), the most common hardware for connecting to networks today. ifconfig is an incredibly powerful tool capable of doing much more than setting IP addresses. For a complete introduction, you should read its man page. For now, we're just going to use it to display and change the network addresses of some ethernet controllers.
darkstar:~#
ifconfig
lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:699 errors:0 dropped:0 overruns:0 frame:0 TX packets:699 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:39518 (38.5 KiB) TX bytes:39518 (38.5 KiB) wlan0 Link encap:Ethernet HWaddr 00:1c:b3:ba:ad:4c inet addr:192.168.1.198 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::21c:b3ff:feba:ad4c/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1630677 errors:0 dropped:0 overruns:0 frame:0 TX packets:1183224 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1627370207 (1.5 GiB) TX bytes:163308463 (155.7 MiB) wmaster0 Link encap:UNSPEC HWaddr 00-1C-B3-BA-AD-4C-00-00-00-00-00-00-00-00-00-00 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
As you can clearly see here, when run without any arguments, ifconfig will display all the information it has on all the ethernet cards (and wireless ethernet cards) present on your system. The above represents a typical wireless connection from my laptop, so don't be afraid if what you see on your system doesn't match. If you don't see any ethX or wlanX interfaces though, the interface may be down. To show all currently present NICs whether they are "up" or "down", simply pass the [-a] argument.
darkstar:~#
ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:19:e3:45:90:44 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:122780 errors:0 dropped:0 overruns:0 frame:0 TX packets:124347 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:60495452 (57.6 MiB) TX bytes:17185220 (16.3 MiB) Interrupt:16 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:699 errors:0 dropped:0 overruns:0 frame:0 TX packets:699 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:39518 (38.5 KiB) TX bytes:39518 (38.5 KiB) wlan0 Link encap:Ethernet HWaddr 00:1c:b3:ba:ad:4c inet addr:192.168.1.198 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::21c:b3ff:feba:ad4c/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1630677 errors:0 dropped:0 overruns:0 frame:0 TX packets:1183224 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1627370207 (1.5 GiB) TX bytes:163308463 (155.7 MiB) wmaster0 Link encap:UNSPEC HWaddr 00-1C-B3-BA-AD-4C-00-00-00-00-00-00-00-00-00-00 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Notice that the eth0 interface is now listed among the returns. ifconfig can also change the current settings on a NIC. Typically, you would need to change the IP address and subnet mask, but you can change virtually any parameters.
darkstar:~#
ifconfig eth0 192.168.1.1 netmask 255.255.255.0
darkstar:~#
ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:19:e3:45:90:44 inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:122780 errors:0 dropped:0 overruns:0 frame:0 TX packets:124347 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:60495452 (57.6 MiB) TX bytes:17185220 (16.3 MiB) Interrupt:16
If you look carefully, you'll notice that the interface now has the 192.168.1.1 IP address and a 255.255.255.0 subnet mask. We've now setup the basics for connecting to our network, but we still need to setup a default gateway and our DNS servers. In order to do that, we'll need to look at a few more tools.
Next on our stop through networking land is the equally powerful route(8). This tool is responsible for modifying the Linux kernel's routing table which affects all data transmission on a network. Routing tables can become immensely complex or they can be straight-forward and simple. Most users will only ever need to setup a default gateway, so we'll show you how to do that here. If for some reason you need a more complex routing table, you would be well advised to read the entire man page for route as well as consulting other sources. For now, let's take a look at our routing table immediately after setting up eth0.
darkstar:~#
route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.1.0 * 255.255.255.0 U 0 0 0 eth0 loopback * 255.0.0.0 U 0 0 0 lo
I won't explain everything here, but the general information should be easy to pick up if you're familiar with networking at all. The Destination and Genmask fields specify a range of IP addresses to match. If a Gateway is defined, information in the form of packets will be sent to that host for forwarding. We also specify an interface in the final field that the information should traverse. Right now, we can only communicate with computers with addresses between 192.168.1.0 and 192.168.1.255 and ourselves through the loopback interface, a type of virtual NIC that is used for routing information from this computer to itself. In order to reach the rest of the world, we'll need to setup a default gateway.
darkstar:~#
route add default gw 192.168.1.254
darkstar:~#
route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.1.0 * 255.255.255.0 U 0 0 0 eth0 loopback * 255.0.0.0 U 0 0 0 lo default 192.168.1.254 0.0.0.0 UG 0 0 0 eth0
You should immediately notice the addition of a default route. This specifies what router should be used to reach any addresses that aren't specified elsewhere in our routing table. Now, when we try to connect to say, 64.57.102.34, the information will be sent to 192.168.1.254 which is responsible for delivering the data for us. Unfortunately, we're still not quite through. We need some way of converting domain names like slackware.com into IP addresses that the computer can use. For that, we need to make use of a DNS server.
Fortunately, setting up your computer to use an external (or even an
internal) DNS server is very easy. You'll need to use your favorite
text editor and open the /etc/resolv.conf
file.
Don't ask me what happened to the e. On my computer,
resolv.conf
looks like this.
# /etc/resolv.conf search lizella.net nameserver 192.168.1.254
Most users won't need the "search" line. This is used to map hostnames
to domain names. Basically, if I attempt to connect to "barnowl", the
computer knows to look for "barnowl.lizella.net" thanks to this search
line. We're mainly interested in the "nameserver" line. This tells
Slackware what domain name servers (DNS) to connect to. Generally
speaking, these should always be specified by IP address. If you know
what DNS servers you should use, you can just add them one at a time to
individual nameserver lines. In fact, I don't know of any practical
limit to the number of nameservers that can be specified in
resolv.conf
, so add as many as you like. Once this
is done, you should be able to communicate with other hosts via their
fully qualified domain name.
But Alan! That's a lot of hard work! I don't want to do this time and again for dozens or even hundreds of machines. You're absolutely right, and that's why smarter people than you and me created DHCP. DHCP stands for Dynamic Host Control Protocol and is a method for automatically configuring computers with unique IP addresses, netmasks, gateways, and DNS servers. Most of the time, you'll want to use DHCP. The majority of wireless routers, DSL or cable modems, even firewalls all have DHCP servers to can make your life much easier. Slackware includes two main tools for connecting to an exising DHCP server and can even act as a DHCP server for other computers. For now though, we're just going to look at DHCP clients.
First on our list is dhcpcd(8), part of the ISC DHCP utilities. Assuming your computer is physically connected to your network, and that you have an operating DHCP server on that network, you can configure your NIC in one shot.
darkstar:~#
dhcpcd eth0
If everything went according to plan, your NIC should be properly configured, and you should be able to communicate with other computers on your network, and with the Internet at large. If for some reason, dhcpcd fails, you may want to try dhclient(8). dhclient is an alternative to dhcpcd and works in basically the same way.
darkstar:~#
dhclient eth0
Listening on LPF/eth0/00:1c:b3:ba:ad:4c Sending on LPF/eth0/00:1c:b3:ba:ad:4c Sending on Socket/fallback DHCPREQUEST on eth0 to 255.255.255.255 port 67 DHCPACK from 192.168.1.254 bound to 192.168.1.198 -- renewal in 8547 seconds.
So why does Slackware include two DHCP clients? Sometimes a particular DHCP server may be broken and not respond well to either dhcpcd or dhclient. In those cases, you can fall back to the other DHCP client in hopes of getting a valid response from the server. Traditionally, Slackware uses dhcpcd, and this works in the vast majority of cases, but it may become necessary at some point for you to use dhclient instead. Both are excellent DHCP clients, so use whichever you prefer.
Manually configuring interfaces is an important skill to have, but it
can become tedious. No one wants to manually setup their Internet
connection every time the system boots. More importantly, you may not
always have physical access to the machine when it boots. Slackware
makes it easy to automatically configure ethernet (and wireless) cards
at system startup with /etc/rc.d/rc.inet1.conf
.
For now, we're going to focus on traditional wired ethernet networking;
the next chapter will discuss various wireless options.
rc.inet1.conf
is an incredibly powerful
configuration file, capable of configuring most of your network cards
automatically when Slackware is started. The file is filled with useful
comments, but there is also a man page that more thoroughly discusses
its use. To begin, we're going to look at some of the options used on
one of my personal machines.
# Config information for eth0: IPADDR[0]="192.168.1.250" NETMASK[0]="255.255.255.0" USE_DHCP[0]="" DHCP_HOSTNAME[0]="" # Some lines ommitted. GATEWAY="192.168.1.254"
This represents most of the information necessary to configure a static IP address on a single ethernet controller. netconfig will usually fill in these values for a single ethernet device for you. If you have multiple network cards in your machine and need all of them activated automatically at boot time, then you'll need to edit or add additional entries into this file in the same manner as above. First, let me go over some of the basics.
As you may have already guessed, IPADDR[n] is the Internet Protocol Address for the "n" network interface card. Typically, "n" corrosponds to eth0, eth1, and so on, but this isn't always the case. You can specify these values to pertain to a different network controller with the INFAME[n] variable, but we will reserve that for the next chapter on wireless networking, as it more commonly pertains to wireless network controllers. Likewise, NETMASK[n] is the subnet mask to use for the network controller. If these lines are left empty, then static IP addresses will not be automatically assigned to this network controller. The USE_DHCP[n] variable tells Slackware to (naturally) use DHCP to configure the interface. DHCP_HOSTNAME[n] is rarely used, but some DHCP servers may require it. In that case, it must be set to a valid hostname. Finally, we come to the GATEWAY variable. It is actually set lower in the file than it appears in my example, and it controls the default gateway to use. You may be wondering why there is no GATEWAY[n] variable. The answer to that lies in how Internet Protocol works. I won't go into an indepth discussion on that subject, but suffice it to say that there is only ever one default route that a computer can use no matter how many interfaces are attached to it.
If you need to use static IP addressing, you will have to obtain a
unique static IP address and the subnet mask for the interface, as well
as the default gateway address, and enter those here. There is no place
to enter DNS information in rc.inet1.conf
, so DNS
servers will have to be manually placed into
resolv.conf
as we discussed above. Of course, if
you use netconfig, this will be handled for
you by that program. Now let's take a look at another interface on my
computer.
# Config information for eth1: IPADDR[1]="" NETMASK[1]="" USE_DHCP[1]="yes" DHCP_HOSTNAME[1]=""
Here I am telling Slackware to configure eth1 using DHCP. I do not need to set the IPADDR[1] or NETMASK[1] variables when using DHCP (in fact, if they are set, they will be ignored). Slackware will happily contact a DHCP server as soon as the machine begins to boot.
Wireless networking is somewhat more complicated than traditional wired networking, and requires additional tools for setup. Slackware includes a diverse collection of wireless networking tools to allow you to configure your wireless network interface card (WNIC) at the most basic level. We won't cover everything here, but should give you a solid foundation to get up and running quickly. The first tool we are going to look at is iwconfig(8). When run without any argument, iwconfig displays the current wireless information on any and all NICs on your computer.
darkstar:~#
iwconfig
lo no wireless extensions. eth0 no wireless extensions. wmaster0 no wireless extensions. wlan0 IEEE 802.11abgn ESSID:"nest" Mode:Managed Frequency:2.432 GHz Access Point: 00:13:10:EA:4E:BD Bit Rate=54 Mb/s Tx-Power=17 dBm Retry min limit:7 RTS thr:off Fragment thr=2352 B Encryption key:off Power Management:off Link Quality=100/100 Signal level:-42 dBm Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0 tun0 no wireless extensions.
Unlike wired networks, wireless networks are "fuzzy". Their borders are hard to define, and multiple networks may overlap one another. In order to avoid confusion, each wireless network has (hopefully) unique identifiers. The two most basic identifiers are the Extended Service Set Identifier (ESSID) and the channel or frequency for radio transmission. The ESSID is simply a name that identifies the wireless network in question; you may have heard it referred to as the network name or something similar. Typical wireless networks operate on 11 different frequencies. In order to connect to even the most basic wireless network, you will have to setup these two pieces of information, and possibly others, before setting up things like the WNIC's IP address.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Table of Contents
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Table of Contents
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.