BUY THIS BOOK
Add to Cart

Print Book $39.99


Add to Cart

Print+PDF $51.99

Add to Cart

PDF $31.99

Safari Books Online

What is this?

Add to UK Cart

Print Book £28.50

What is this?

Looking to Reprint or License this content?


SUSE Linux
SUSE Linux By Chris Brown, PhD
July 2006
Pages: 446

Cover | Table of Contents


Table of Contents

Chapter 1: Quick Start
I have never liked delayed gratification. I don't buy self-assembly furniture or bake cakes from scratch—there's too much waiting involved. Bonsai? You must be joking! With software products and operating systems especially, I want to start putting them to use the instant I have them in hand. Hopefully, this book will help you do that with SUSE Linux. In particular, this first chapter is intended to get you started quickly—to get the system installed; to get your printer, email, and network set up; and to take a step on the road to self-sufficiency through reading the documentation. Changing your operating system is like moving to a new home. You need to figure out how to turn on the electricity, water, and heating. You need to make a hot drink. You need to get the bed assembled before nightfall. Unpacking your CD collection can wait.
Once the system is installed, I suggest you spend some time exploring the menus. From web browsers to HTML editors, from databases to CD players, from image editors to chess programs—there's just so much stuff! And that's just the graphical tools. A whole new world of command-line utilities also awaits you. As the SUSE folks say, "Have a lot of fun."
Not too long ago—five years, maybe—installing Linux required a great deal of patience and technical know-how. Getting it to work properly on a laptop was especially tricky, rather like teaching chickens to fly. Anyone found in possession of a flying chicken would be besieged by questions from others anxious to see their pet hen airborne. Since then, the device support in Linux has improved beyond recognition; the installation tools in a modern Linux distribution auto-detect most hardware, install the right drivers, and deliver a default installation that is almost certainly going to work.
In this lab I walk through a typical installation of SUSE Linux from local media (in this case, a DVD or set of CDs). Everyone's installation is different, of course. You may be installing onto a completely "empty" machine, or you may wish to preserve existing partitions and operating systems. You may have specific requirements for the selection of software you want to install. You almost certainly have different hardware than I do. For this walk-through, I use a desktop machine of dubious breeding (I built it myself), which has an existing installation of Windows 2000 (which I will keep) and an existing installation of an earlier version of Linux (that I will replace). Depending on which version of SUSE Linux you're installing, there may be some minor differences between the screens you'll see and the screenshots in this book.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Installing SUSE Linux from Local Media
Not too long ago—five years, maybe—installing Linux required a great deal of patience and technical know-how. Getting it to work properly on a laptop was especially tricky, rather like teaching chickens to fly. Anyone found in possession of a flying chicken would be besieged by questions from others anxious to see their pet hen airborne. Since then, the device support in Linux has improved beyond recognition; the installation tools in a modern Linux distribution auto-detect most hardware, install the right drivers, and deliver a default installation that is almost certainly going to work.
In this lab I walk through a typical installation of SUSE Linux from local media (in this case, a DVD or set of CDs). Everyone's installation is different, of course. You may be installing onto a completely "empty" machine, or you may wish to preserve existing partitions and operating systems. You may have specific requirements for the selection of software you want to install. You almost certainly have different hardware than I do. For this walk-through, I use a desktop machine of dubious breeding (I built it myself), which has an existing installation of Windows 2000 (which I will keep) and an existing installation of an earlier version of Linux (that I will replace). Depending on which version of SUSE Linux you're installing, there may be some minor differences between the screens you'll see and the screenshots in this book.
Start by booting from the DVD included with your SUSE Linux distribution. (If your machine won't boot from DVD, or if you've created the CDs by downloading ISO images from the OpenSUSE web site [http://www.opensuse.org], boot from CD1.) You will be presented with an initial boot menu that will (if you let it time out) boot from the hard drive. This isn't what you want, so select "Installation" from the menu. A Linux kernel and a RAM-disk image will now be loaded from the DVD or CD. The RAM-disk image is a small filesystem, held in memory, that Linux uses during the installation. You'll be asked to select the language you want to use for the installation.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Set Up a Local Printer
Moving to a new computer, or to a new operating system, is a bit like moving into a new house. It takes a while to feel comfortable in it, and to get all your stuff arranged just how you want it. And if you're moving, one of the first things you'll want to do in your new home is make a cup of tea. So, it's particularly important to clearly label the packing case in which you packed the tea bags and the kettle. Similarly, if you're migrating to a new desktop operating system, one of the first things you'll want to get working is your printer.
If you're living in a country, such as the United States, where it is almost impossible to buy anything that the British would regard as even remotely resembling tea, feel free to think of coffee and coffeepots.
In this lab you'll see how to set up a locally connected printer. In Chapter 2 you'll see how to connect to a print server across the network.
You will configure the printer using YaST (Yet another Setup Tool). YaST is an integrated collection of modules that perform a wide variety of system administration tasks from a graphical user interface. It is a key component of SUSE Linux and you will meet it many times in this book.
If your printer was plugged in when you installed SUSE Linux, you'll probably have been offered the opportunity to configure it at that stage. If not, it is easy to add a locally connected printer. In fact, if you simply plug in a printer to a USB port, SUSE should automatically detect it and display a New Hardware Found dialog box asking whether you want to configure it. Answering Yes in this dialog box will start the YaST printer module. As always, when YaST starts up, it will display the Run as Root screen to ask you for the root password. YaST should auto-detect the printer and include it in the list of available printers in the main printer configuration screen, as shown in Figure 1-9.
Figure 1-9: YaST main printer configuration screen
Select the printer from the available printers list and click Edit. This will take you to the Edit Configuration screen shown in Figure 1-10.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Get Started with Email
After getting your printer set up, one of the next things you will want to get working on Linux is email. Assuming that you have Internet connectivity (either broadband or dial-up), this process is quite straightforward. There are many mail user agents for Linux. (Mail user agents are the programs that let you read, compose, and organize your mail.)
Both KDE and Gnome desktops include graphical mail user agents; for KDE there's KMail and for Gnome there's Evolution. Mozilla Thunderbird is also available, but is not installed by default. If you're coming from a Windows background, think of these as roughly equivalent to Outlook Express.

Section 1.3.1.1: Kmail

Start Kmail from the KDE desktop using Main Menu → Internet → KMail. (Later, you may want to add a launch icon for KMail onto the toolbar. You'll see how to do that in Chapter 3.) The very first time you launch Kmail, it will offer a wizard that guides you through a few screens to set up an initial account. I recommend that you cancel the wizard on its first screen, and proceed to the main KMail screen, from which you can set up your own accounts.
Before you can send and receive email with Kmail you will need, at minimum, to define an "identity" and specify your ISP's inbound and outbound mail servers.
Incoming mail is usually received from a POP3 or IMAP server. Outbound mail is usually sent to an SMTP server. The mail servers for incoming and outgoing mail are entirely separate and may not even be operated by the same service provider. In any case, they need to be configured separately in KMail.
From KMail's main menu, select Settings → Configure KMail. The configuration dialog has several sections that you can select via the pane on the left. Begin by selecting Identities. An identity is basically just a named collection of KMail configuration settings. You probably won't need to define more than one of these, so click Modify to edit the default identity. Complete the form by entering your name, organization and email address (as you would like them to appear on outbound mail) and click OK.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Configure a Network Card
It's perfectly possible to install and operate a completely standalone Linux system with no network connection at all, but it's rather unusual. Most systems need to connect to a local area network, either in the office or at home. In this lab you'll see how to configure a network card to connect to a local wired network (i.e., Ethernet). I'll begin by looking at the traditional YaST way (which requires the root password), then I'll look at a couple of more recent applets (netapplet and NetworkManager) that allow easy—though limited—management of network interfaces without root privilege. In Chapter 6, you'll see how to set up wireless networking.
If your network card was auto detected during installation, you will have been offered the opportunity to configure it at that stage. If not, or if you need to configure it later, use YaST (K Menu → System → YaST).
On YaST's main screen, select Network Devices from the panel on the left, then Network Card from the panel on the right. On the main network card configuration screen, you will see a list of available (but unconfigured) cards. To configure one of these, select it from the list and click Configure.
A list of already-configured devices is shown at the bottom of the screen. To change one of these, click Change. On the next screen, titled Network Card Configuration Overview, you'll again see the list of configured cards. They will probably have names like "eth-id-00:01:02:8E:21:9." Select the card that you want to configure and click Edit. This will bring you to the Network Address Setup screen shown in Figure 1-15.
Figure 1-15: Assigning an IP address
The easiest way to configure a network card is to select Automatic Address Setup (via DHCP). Using this method, the machine will broadcast a request over the network when it starts up (or to be more accurate, whenever the interface is activated), hoping to find a DHCP server that will supply its IP address, subnet mask, default gateway, and other network settings. This choice is usually appropriate if you are putting your machine onto a corporate network, which probably operates a DHCP server. If you have a home network with an ADSL modem/router, it's likely that the router offers DHCP, so you can use this setting here also.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Access Documentation
It used to be said that Unix and Linux were short on documentation. Nowadays, if anything, there's too much. This lab will guide you to some of the sources of documentation.
I will deal first with the most traditional source of documentation for Unix and Linux systems, the so-called "manual" pages, often abbreviated to "manpages." The usage and format of these goes back many years. They were originally intended to document the command-line tools, and that is still their main purpose. You will, generally speaking, not find manpages for the graphical tools.
From a command prompt, access the manpages with the man command; for example:
chris@snowhite:~> man gcc
will show the manual page for the GNU C compiler (the first screen of it is shown in Figure 1-19).
Figure 1-19: The manual page for gcc
As you'll see even from this small example, the manpages are very terse. The content is provided under various standard headings—NAME, SYNOPSIS, DESCRIPTION, OPTIONS, and so on. Most of them have a SEE ALSO section near the end, which provides a cross-reference to related commands. The manpages vary enormously in length and complexity. The page for the id command is just 64 lines. The page for gcc is over 9,000 lines. When viewed from a command prompt, manpages are piped through the program less to allow you to browse them. I discuss less in more detail in Chapter 2, but for now it is sufficient to know that you can press the up and down arrow keys to scroll through the material, and q to quit.
Of course, looking up a command by name works only if you already know the name of the command. If you don't, you can try using the apropos command to search the keyword-in-context index of the manpages and show matching entries. For example:
chris@snowhite:~> apropos compiler
will show you all manpages with the word 'compiler' in their 'NAME' section.
There are other ways to access the manpages. From the Konqueror browser, for example, entering "man:gcc" into the location field will show you the manpage for gcc. It is formatted to look a little prettier than viewing it from the command prompt, but it's derived from exactly the same unformatted source, so the actual content is identical.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Chapter 2: Basic System Administration
Once upon a time, Unix (the forerunner of Linux) had no graphical desktop at all. A command prompt was the only user interface. Of course, Linux now has a high-quality, modern, graphical desktop (indeed, it has more than one). Nowadays there are tools that let you perform most system administration through a graphical interface (in particular YaST, in SUSE Linux). Nonetheless, Linux retains its command-line interface (you'll also hear this referred to as a shell prompt, "shell" being the Linux name for a command interpreter), and you'll find plenty of Linux users (especially the hardcore geeks) who prefer this interface to the graphical tools. Throughout this book, I'll often discuss how to perform a particular task using graphical tools and how to do the same thing from the command line. It is not my intention to embark on a religious crusade in favor of either the graphical desktop or the command line. Both have their strengths and weaknesses. Which you prefer depends largely on your background and expectations.
It is easy to access a command prompt from a Linux desktop. In KDE, for example, select System → Terminal → Konsole from the main menu. There is also an icon on Kicker (the KDE main panel). Either method will bring up a terminal window and start a shell. For a really old-fashioned, authentic view of the command line, you can use the shortcut keys Ctrl-Alt-F1 through Ctrl-Alt-F6 to view up to six virtual terminals on which you can log in and enter commands. (From a virtual terminal, use Alt-F7 to return to the graphical desktop.) When comparing Linux to Windows, it's important to note that you don't have to install a window manager or any graphical applications if you don't want to. Indeed, Linux systems intended for use as, say, a mail server or a database server are usually set up this way.
When the shell is ready for another command, it prints a prompt. The prompt can be configured to be anything you want, but by default it is of the form:
username@hostname:directory>
For example:
chris@snowhite:~>
Note that the tilde (~) is a shorthand notation meaning "my home directory." For simplicity, in this book I show the prompt simply as
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
View and Edit Text Files
Linux uses a lot of files that contain "plain old text," including (almost without exception) all system-wide and user-specific configuration files. Being able to view and edit such files is a key skill for driving Linux in anything beyond first gear. This lab looks at some of the tools for viewing and editing plain text files, and covers both graphical tools and command-line tools.
If you're using a graphical desktop, clicking on a text file in either the Konqueror file browser (KDE) or in Nautilus (GNOME) displays the contents of a text file in the browser's window.
From the command line, a good tool for viewing a text file is less. It's easy to run: you just supply the filename as an argument:
$ less /usr/share/doc/packages/sodipodi/README
The name less is a reference to an earlier and simpler program called more, which let you browse through the file a screenful at a time. Each time you pressed the spacebar, you saw more of the file. The later program less is actually fancier; in particular, you can page up as well as down through the file. "Less is more" is the wisdom on the streets. You will discover that the names of many Linux commands are either (a) an historical accident, (b) an obscure reference to something that came earlier, or (c) a testimony to the somewhat limited sense of humor of people who give names to Linux commands.
When you run less, it will display the first screenful of the file, then pause, wondering what to do next. There are many single-character commands that you can enter at this stage; typing h will show you a command summary (the top part of which is shown in Figure 2-1), but you can drive less satisfactorily with rather few commands (see Table 2-1).
Figure 2-1: Part of the help screen for less
Table 2-1: Key commands for less
Command
Description
Spacebar or Page Down
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Explore the Filesystem
Linux, like Windows, has a hierarchical filesystem. That is, there is an organization of folders and subfolders arranged in a tree. In the Linux world, you are more likely to hear folders referred to as directories; the two terms are interchangeable. If you're coming from a Windows background, there are a few differences you'll need to get accustomed to.
First, a typical pathname for a file in Windows looks like this:
C:\Program Files\Adobe\Acrobat 6.0
Here's an example of a pathname in Linux:
/opt/mozilla/bin
First, notice that Linux uses forward slashes ("/") to separate the components of a path name, not backslashes ("\"). This is easy to get used to. Second, Linux does not use drive letters like C: and D:. I know that users coming from a Windows background have grown very attached to their drive letters and sometimes view their absence in Linux as an omission. I would prefer that you see it as progress. Even though a filesystem on Linux may be split across several drives (including hard disk partitions, removable media such as CDs, and filesystems on remote file servers), everything is assembled together into a single filesystem tree. When you make reference to a file, you do not need to know which drive it is on, or whether it is local or remote—you just need to know its name. You'll see how this works later.
The most significant differences between the Windows and Linux filesystems, however, lie in the actual organization—the actual names of the directories and the details of what goes where. This lab describes that organization and also examines the tools that will allow you to explore the filesystem.
From the KDE desktop, use Konqueror to browse the filesystem. Konqueror is the Linux equivalent of Windows Explorer. To launch Konqueror, click on the blue "home" icon on the main panel. This will launch Konqueror in your home directory. Konqueror has several view modes, selectable from the View → View Mode menu. These include:
An icon view
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Manage Files and Directories
There are some fundamental skills needed for any operating system—the ability to create, move, rename, and delete files and directories—that everyone needs. This lab shows how to do those things using both the graphical desktop and the command line.
The previous lab discussed the use of Konqueror and the command-line tools to browse the filesystem. Table 2-5 compares some graphical and command-line operations.
Table 2-5: Comparing graphical and command-line operations
To do this
In Konqueror
From a command prompt
Delete a file
Right-click the file and select Move to Trash from the context menu.
$ rm filename
Rename a file
Right-click the file and select Rename from the context menu. Enter the new name.
$ mv oldname newname
Copy a file
Control-click to select the file, then type Control-C or select Edit → Copy from the menu. Navigate to the destination directory, and then type Control-V or select Edit → Paste from the menu. You can also copy files using drag-and-drop between two Konqueror windows.
$ cp oldname newname
Create a file
Right-click a whitespace area and select Create New from the menu that appears.
$ touch filename
There is rather more power and subtlety in the command-line tools than the table suggests. For one thing, all of the commands can operate on multiple files. So, for example:
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Set File Access Permissions and Ownership
So far, I have conveniently ignored the issue of access permissions (i.e., who can do what) on files. Traditionally, a full discussion of the Linux security model is part of any introductory Linux course or text. But in fact, if you have a basic Linux setup with just a few user accounts on it, you can get by without knowing much about the security model at all because Linux will, for the most part, just do the right thing.
"The right thing" basically means this:
  • You will be able to view and modify any files that you yourself create.
  • You will be able to view (but not modify) the contents of files created by other users who have accounts on the system. (This may be a more permissive arrangement than you'd like.)
  • You will be able to view (but not modify) most system files.
  • If you're logged in as root, you can do anything!
This lab explores the underlying security model in Linux and shows how to change a file's ownership and access permissions, both from a graphical interface and from the command prompt.
To view or change a file's attributes using Konqueror, right-click the file and select Properties from the file menu. In the file properties dialog, the General tab shows the file's size and its timestamps. You cannot edit these. Click the Permissions tab to see and change a file's ownership and access permissions. This dialog provides drop-down lists to allow you to set the access rights on the file to be read/write, read-only, or forbidden (no access). You can set the permissions separately for the owner of the file, for members of the file's group, and for everyone else (Others).
These permission sets are actually a slight simplification of the real underlying permissions, which you can see if you click Advanced Permissions. Figure 2-7 shows the permissions dialog and the advanced permissions screen.
Figure 2-7: Showing file permissions in Konqueror
Ignoring, for the present, the Special permissions shown in Figure 2-7, you can see that each file carries read, write, and execute permission for its user (meaning the owner), members of the file's group, and everyone else. Read and write are hopefully self-explanatory. Execute permission allows the file to be executed as a command and is really only appropriate for fully compiled applications (what Windows would call an
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Access a Remote Printer
I have a confession to make. I don't understand how printing works in Linux. Back in the days of the lpd printing daemon in Unix, I had a reasonable idea of what was going on. I could even get it to work. Nowadays, most Linux printing is done using CUPS (the Common Unix Print System). Although in some ways it's much easier to use (you just press the obvious buttons and—hey presto!—it works), the underlying architecture is something of a mystery. I put this lack of understanding down in part to my advancing years, but also in part to the lack of a really good description of the CUPS architecture. Also, it is difficult to disentangle the underlying CUPS system from the printer configuration tools that are supplied as part of the KDE desktop and as part of YaST.
Notwithstanding these problems, in this lab you'll learn how to set up your SUSE Linux system to print to a remote printer.
You can configure access to a remote printer using YaST. From the main YaST screen, select Hardware from the panel on the left, and then Printer from the panel on the right. This will bring you to the top-level Printer Configuration screen. From this screen, click on Add. The next screen asks if your printer is local ("Directly Connected") or remote ("Network Printers"). Select Network Printers at this point. This will bring you to the Printer Type screen shown in Figure 2-9. (In versions of SUSE Linux prior to 10.1, selection of local and remote printers was combined into a single screen.)
Figure 2-9: Defining the connection type for a remote printer
This screen is poorly named. It really refers to the type of the connection, rather than the type of the printer itself. As you will see from the figure, you can define queues to remote printers using a variety of protocols (CUPS, LPD, SMB, IPX, and network printers). In this lab, you need to select "Print via CUPS Network Server." On the next screen, labeled Connection Type, you have three choices:
CUPS client only
This selection is appropriate if your network has a single CUPS server that has multiple printer queues. All the named print queues on this server will be made available for use on your machine. "Client only" is a convenient and reliable way of working, and I would recommend it if your machine stays connected to a single network. Note, however, that it can cause problems if you take your machine off that network, as some applications (notably OpenOffice and Firefox) present very long start-up delays (several minutes) as they try to enumerate the printer queues on a nonexistent print server. I have even seen delays in restarting the YaST printer module if the print server is taken offline.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Create User Accounts
Creating user accounts is one of the most fundamental tasks of system administration. Even in the simplest case of a machine intended for use by a single person, you should create a proper user account for yourself. In Windows installations, it's not uncommon to create just one user account that has administrative privileges and to use that for everything. Doing this on Linux is a really bad idea (actually, it's a bad idea on Windows, too) because if you're permanently logged in as root, there are no underlying safeguards to stop you from inadvertently deleting or overwriting vital files, or to prevent malicious scripts or programs that you run from doing bad things to your system.
For a machine intended for home use, you should create accounts for everyone who wants to use your machine: your roommate, your spouse, each of your kids, and so on. That way, everyone can maintain their own preferences and settings and have a piece of the filesystem (their home directory) to call their own. For a machine intended for use as a company-wide server, you may find yourself maintaining hundreds or thousands of user accounts.
As with most things, there are graphical and command-line tools for creating and managing user accounts. All these tools manipulate the same underlying files and account information.
Some people talk about "creating users" rather than "creating accounts," but to literal-minded folk like me, creating users is a biological activity well outside the scope of this book.
There's a YaST module for managing user accounts. From YaST's main screen, select Security and Users in the panel on the left, and then choose User Management from the panel on the right. This will bring you to the main user management screen shown in Figure 2-10.
Figure 2-10: The main user administration screen in YaST
Click on the Set Filter button and select Local Users. This will allow you to manage user accounts that are stored in local files. From this screen you can add new accounts or edit and delete existing accounts.
To add a new local account, click Add. This will bring you to the New Local User screen shown in Figure 2-11.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Rescue a System That Won't Boot
You don't usually expect problems at boot time. You expect to simply switch on and be greeted by a login prompt soon after. So it can come as a bit of a shock if the boot process comes to a screaming halt. This lab examines some techniques for recovering systems that won't boot, and, as a side effect of this, how to recover if you forget the root password.
There is no "one size fits all" solution to the problem of fixing systems that won't boot, but I offer some general pieces of advice: first, you need some understanding of how the system is supposed to boot in the first place, and second, you need to read the boot-time messages very carefully and try to figure out how far the boot process actually got and what the first indication of trouble was (i.e., the first error message). I emphasize "first" here because the system may stagger on a ways and produce further messages or errors before actually stopping.
SUSE Linux normally covers up the boot-time messages with a pretty splash screen. To view the boot process in detail, press Escape (or F2 in some versions).
My third piece of general advice is even more obvious. Most boot-time failures occur as a result of making some configuration change, so it helps if you can remember what you changed! (And as a rule, when you're changing something tricky, make one change at a time, reboot to make sure all is well, and move on to the next change.)
Assuming that the boot process gets as far as loading the boot loader GRUB (GRand Unified Bootloader), it will, left to its own devices, time out and boot using whatever commands are defined as the default in its configuration file /boot/grub/menu.lst. You can interrupt the process by pressing Escape when you see GRUB's boot menu. This will drop you into a character-mode interface that will allow you to edit the GRUB commands that will be used to boot the system, or even to type new commands in from scratch. A common use of this technique is to append parameters to the settings used to boot the kernel. In particular, appending the word single to the kernel command in grub will make the kernel boot in single-user mode.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Finding Files
It's not unusual to forget where you put a file that you've created or downloaded from the Internet. Or, you might have questions about what you've got installed—for example, do I have the libdvdcss library? Then you unexpectedly run out of space on a partition—is there some giant file filling it up that you don't know about? As another example, suppose you've just removed the account for the user dave. Presumably most of dave's files were in his home directory, /home/dave, but are there any files anywhere else owned by dave?
SUSE Linux provides both graphical and command-line tools that will let you search the filesystem (or a specified part of it) for files that meet various criteria. You can search on the filename (either a complete or partial match) or on the file's attributes, (such as its size or ownership or time of last modification), or even on a string match on the file's contents.
KDE includes a graphical tool called kfind. From the main KDE menu, select Find Files. This will display the file finder dialog, which has three tabs under which you can enter search criteria: Name/Location, Contents, and Properties. Simple name-based searches can be performed using only the Name/Location tab (Figure 2-14). Enter the name, check the Include subfolders box if you want the search to recurse down into directories below the one you start in, and click Find.
Figure 2-14: Name-based file search using kfind
The filename you enter in the Named text box can include the same *, ?, and [...] wildcard notations that the shell understands. For example, [A-Z]*.png will find files whose name begins with an uppercase letter and ends with .png.
You can combine name-based searches with searches based on the file's content using the Contents tab, and with searches based on file attributes such as ownership, size, or time of last modification using the Properties tab. (Figure 2-15 shows a search for files larger than 100 MB.) A list of all the files that were found will be shown in a scrollable window at the bottom of the tool. You can sort the files on any of the column headings displayed (name, size, and so on) by clicking on the column heading.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Mounting Filesystems
One of the key differences between Windows and Linux is that Windows uses drive letters such as C: and D: and Linux does not. I have met people who are transitioning from a Windows desktop to Linux, and who are so used to drive letters in Windows that they are seriously discomfited by their absence in Linux. "How do I know where to find my stuff if there are no drive letters?" is a question I've been asked more than once. It is tempting for an experienced Linux user to dismiss such questions as naïve, but the reality is that many people come to Linux with their expectations and prejudices set by the way Microsoft does things, and those people deserve a proper explanation of why things are different in Linux (and, perhaps, why the advocates of Linux would consider it superior).
My own view (just as biased as anyone else's, in its own way) is that drive letters represent an implementation issue that should really be hidden from users. Why should I need to know which drive a file is on (or even whether it's on the local hard drive or on a network server)? Surely, I should just need to know the name of the file?
Linux provides the illusion of a single filesystem tree (even though in reality that filesystem might be spread across multiple physical disks, removable media, and network file servers) by attaching pieces of the filesystem into the overall naming tree that starts at the root (/). The operation of attaching a filesystem in this way is known as mounting, and is the subject of the rest of this lab.
A filesystem contained on a partition of a local disk drive can be mounted using a command something like this:
# mount -t ext3 /dev/hda5 /usr/local
Here, -t ext3 specifies the type of the filesystem to be mounted. The mount command will usually figure this out for itself, so this argument is often not necessary. /dev/hda5 is the partition containing the filesystem that you want to mount, and /usr/local is what's called the mount point. The mount point is usually an empty directory within the root partition created specifically for that purpose. (It is possible to mount onto a nonempty directory, and if you do, the original contents of the directory are "covered up" by the contents of the mounted filesystem and will reappear when the mount is removed, but it is not usual to do this, except by mistake.)
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Access Your Desktop Remotely
Have you ever been in the position of trying to help someone perform some task with his or her computer, but not being physically in front of the machine? Trying to talk someone through a multistep process with a graphical user interface can be quite difficult and frustrating.
Interestingly, it's actually easier to talk a remote user through using a command line than a graphical interface because you can explicitly specify the commands rather than engaging in vagaries such as "click the little button just under the penguin."
An application called VNC (Virtual Network Computing—not the best of names) lets you access a desktop session on a remote machine. The remote machine runs a VNC server, and the local machine runs a VNC viewer. This lab explores the use of VNC to start up and access a brand new desktop session, and how to use the tool Krfb to gain shared access to an existing desktop.
VNC is a client/server application. The server (which runs on the "target" machine—that is, the machine whose desktop you want to control) is called Xvnc, and the client (which runs on the machine you're actually sitting at) is called vncviewer.
If you want to set up a desktop session that can be accessed remotely, begin by running vncpasswd on the target machine. This process will ask you for a password, encrypt it, and store it in ~/.vnc/passwd. Optionally, you can specify a "view only" password which, if you use it to connect to the target machine, will allow you to passively observe a desktop, but not actively control it.
Next, start the server using vncserver. This is a Perl script in /usr/bin. It is essentially a "wrapper" that starts the VNC server, Xvnc, with appropriate arguments.
vncserver will report the desktop number of the desktop session it has started. You will need this to connect to the session using vncviewer. In the following example, the desktop is ":1".
$ vncserver

New 'X' desktop is snowhite:1

Starting applications specified in /home/chris/.vnc/xstartup
Log file is /home/chris/.vnc/snowhite:1.log
As the preceding example shows, vncviewer reads the file
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Chapter 3: Using SUSE Linux on Your Desktop
This chapter looks at SUSE Linux through the eyes of an end user (whatever that is!) and examines how to do some of the everyday things that end users do—configure the desktop to look pretty, play multimedia files, burn CDs, and so on. The assumption is that you'll be using a graphical desktop interface to do most of these things, though you'll see how to do some of them from the command line, too.
It will probably help you make sense of what's going on in some of these labs if you know a little bit about the graphics architecture in Linux first. If you are coming from a Microsoft Windows or Mac OS background, you will find it's rather different.
The key point to understand is that the Linux windowing system uses a client/server architecture. The server component, which runs on the machine where the physical user interface resides (the screen, keyboard, and mouse), is called the X server. The client components (any applications that wish to present a graphical user interface) may run on the local machine, or may be remote, as shown in Figure 3-1. In a nutshell, any time a program (such as the Firefox web browser or OpenOffice word processor) wants to put a character up on the screen or draw a picture, it has to ask the X server to do the drawing on its behalf.
Figure 3-1: X client/server architecture
The X server provides the basic capability to render text and graphical elements onto the screen and to retrieve input from the keyboard and mouse (or other pointing device). The X server provides "mechanism, not policy"; that is, it does not define a look and feel for a graphical application—that's up to the application itself and the graphical toolkit that it uses. The X server does not even provide basic window management—those decorations around a window that allow it to be moved, resized, minimized, maximized, or closed. These features are provided by a window manager, which, in terms of the client/server architecture of X, is just another client of the X server.
Newcomers to this architecture sometimes puzzle over the client/server relationships here, thinking that they're the wrong way around. People are used to clients running locally, with the servers possibly being remote. Here, the X server always runs locally, and it's the clients that might be remote. If you think about the service that's being provided (essentially just access to the physical user interface), then it makes sense.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Configure Your Graphics Card and Monitor
Getting the X server to properly drive your graphics card and your monitor used to be among the darkest magic involved with a Linux installation. Nowadays, thanks to vastly improved auto-probing of the hardware and much better configuration tools, in most cases it is a simple point-and-click process. Indeed, you were probably taken through the process by the YaST installer and already have a system working at the correct resolution. If you do, you can probably skip this lab!
SUSE Linux includes an X server configuration tool called sax2. You can run this from the main YaST screen by selecting Hardware from the panel on the left, then Graphics Card and Monitor from the panel on the right. You can also run sax2 directly from the command line; in fact, you can even run it from a terminal window without having a graphical desktop running at all. However, sax2 requires a graphical user interface and will start its own X server if it needs to. The main screen of sax2 is shown in Figure 3-2.
Figure 3-2: The main screen of SaX2
From this screen, you can set the resolution and color depth of the display. The color depth refers to the number of bits that are used to represent the color of each pixel on the display. Greater color depth gives more colors and hence greater color fidelity. A 16-bit color depth is adequate for older machines, and will often give better performance. However, if you have a recent mid-range to high-end video card, you won't take a performance hit by using 24-bit color (and you'll enjoy the full effect of the latest eye candy in GNOME or KDE). You will probably want to set the spatial resolution to the highest that your monitor is capable of (if you have an LCD monitor and you use a setting that's less than the maximum, your LCD monitor will have to scale the display, leading to unpleasant visual artifacts). Under some circumstances, if you set the resolution higher than this, you'll get a "window" (whose size is determined by the physical resolution of your screen) that you can pan and scroll around within a larger desktop (whose size is determined by the resolution you specify) using the mouse. I don't like this mode of operation.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Configure Your Keyboard and Mouse
Living, as I do, in England, it is a constant source of wonder to me that I can get on a Eurostar train in London and arrive two hours later in a country where they make strange noises with their mouths that I cannot understand. That is, they speak French. There is no directly analogous experience in the United States, though a New Yorker might try getting on a plane to Birmingham, Alabama, and attempt to hold a conversation with a taxi driver there. In addition to TV programs like Big Brother, one of the penalties of being a highly evolved species is that we have no global standard for language, except for (in the case of the Brits) shouting slowly in English on the assumption that anyone who doesn't understand that isn't worth talking to.
It is hard to know the score for lower life forms but I am prepared to bet good money that English mice and French mice have no such barrier to communication, apart, perhaps, from a minor disagreement on the relative merits of Camembert and Wensleydale. We don't even agree with the French on how to write dates, whistle the National Anthem, or lay out the keys on our keyboards. Our qwerty is their azerty. We have no idea how to put a cedilla under our c's or a circumflex over our a's.
It's not just the French. The Spanish have their own ideas how to do things. Their qwerty is in the right place, but they have these weird upside-down question marks and twiddly things (I think they're called tildes) over their letter N. Even the Yanks and the Brits disagree over keyboard layouts. Americans looking for the @ sign or Brits looking for the quotation mark over the 2 on the wrong side of the pond will be well adrift. To the Brits, a pound sign is a currency symbol like this: £. To the Americans, a pound sign looks like this: #. I once tried to explain this to a class in San Francisco and came close to being lynched in disbelief. In desperation I circulated a British banknote around the class to show what a "proper" pound sign looks like. It didn't help, though I did get the note back. If this kind of thing interests you, I recommend that you visit Michael Quinion's wonderful web site at
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Configure the KDE Menus and Panel
The KDE desktop is customizable in almost endless detail. You can change the background wallpaper, the screensaver, the color scheme, the icons, the menus, the panel, the shortcut keys, and much else. Some of these changes bring real improvements in productivity, but in my experience, extensive tinkering with the desktop is often used as a displacement activity to avoid doing any real work. In this lab, we'll see how to customize the menus and the panel.
To customize the main menu, right-click on the main menu button at the left end of the main panel, and select Menu Editor from the pop-up menu. (You can also run kmenuedit from a command prompt.) The menu editor screen has a tree control in the panel on the left that allows you to navigate through the menu hierarchy. For the sake of a simple example, here's how to add a shortcut key to invoke the Konsole terminal window:
  1. You already know that this application is on the menu under System → Terminal → Konsole, so navigate through the tree view control accordingly, expanding System, then Terminal, and finally selecting Konsole.
  2. The menu editor will display the current settings for this menu entry as shown in Figure 3-7. There is probably no shortcut key currently allocated. To set one, click on the button labeled "Current shortcut key."
  3. In the dialog labeled Configure Shortcut, make sure that the radio button labeled "Primary shortcut" is selected, then enter the key combination you want to use as the shortcut—for example, Alt-T. (Do not be tempted to use a printing character such as Shift-T. If you do, every time you try to type an uppercase T, you'll launch a terminal window!)
  4. From the KDE Menu Editor's menu, select File → Save to save the new settings, then quit the application.
Figure 3-7: The KDE Menu Editor
As another example, let's add a new menu item. There's a handy program called top that displays a useful summary of the system load and the most resource-hungry processes currently running. System administrators find it useful for monitoring the health of busy servers. Here's how to put it on the System → Monitor menu:
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Configure the KDE Desktop
KDE users fall broadly into one of two camps: there are those who are happy to leave the look and feel of their desktop entirely alone and get on with some work, and there are those to whom it is important to have their window borders exactly the right shade of pink, see a different picture of their pet tortoise behind each virtual desktop, and hear a drum roll each time they open a window. It is to this latter group that this lab is dedicated.
Some of the most common desktop configuration options are available by right-clicking on the desktop and selecting Configure Desktop from the pop-up menu. In this tool, you can make changes in five categories, which are selected by clicking on the icons in the pane on the left.
On the Background settings screen, you can:
  • Set a background image for the desktop. You can either set the same background for each virtual desktop or set a different one for each. There is quite an extensive collection to choose from, or you can import your own images and use those. You can even select a "slide show," which cycles around a specified collection of images at a specified rate.
  • Select a color instead of a background image—either a simple solid color or a gradient between two colors.
  • Select a blend between a background image and a color or color gradient.
On the Behavior settings screen, you can:
  • Turn the desktop icons on or off.
  • Turn the desktop menu bar on or off. (This menu bar mostly duplicates the functions available by right-clicking on the desktop.)
  • Turn on a Mac OS-style menu bar. In this mode, a menu bar corresponding to the application that currently has input focus appears at the top of the desktop. This is the normal style for a Mac desktop, so if you're from a Mac background, you will probably like it; if you're not, you probably won't.
  • Determine the behavior of the left, middle, and right mouse buttons when clicked on the desktop.
On the Multiple Desktops screen, you can:
  • Set the number of virtual desktops (up to a maximum of 16, though I find 4 is the maximum I can keep track of).
  • Give names to the virtual desktops.
On the Screensaver screen, you can:
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Lock Down the Desktop for Kiosk Mode
The configurability of KDE is one of its great strengths. However, there are situations when you'd like to restrict the amount of configuration that end users can perform. Examples of this are Linux-based kiosk applications, such as an information terminal in a library or airport, computers in Internet cafés, the computer you set up for your aging (and technically inept) aunt and uncle, and even corporate desktop systems intended for nontechnical users. In this lab, you'll see how you can lock down the desktop (for example, you can prevent the user from logging out, stop them from changing the icons and files on the desktop, disable context menus, and much else besides) for these situations.
As a (completely irrelevant) aside, a Linux-loving friend of mine called Bob tells the slightly tongue-in-cheek story about setting up a computer for his elderly parents so they could do email and surf the Web, or at least paddle in it. Of course, he chose to set up a Linux system. He spent some time explaining how to use it and went away, doubtful of how well they'd manage. Over the next few weeks Bob received a lot of phone calls asking for clarification on how to do this and that, but the calls tapered off and eventually stopped altogether. Suspecting that they'd simply given up, on his next visit home he made a point of asking how they were getting on. "Oh, we're doing fine," they assured him. "Is there anything you want to ask while I'm here?" he enquired. "Well," they said, "There is one thing. Since we got a computer, we've been talking to our other friends who have computers, and there's something they seem to do a lot of that we don't know how to do." "Oh, what's that?" asked Bob. "Well," they said, "We'd like to know how to reboot."
First, you will need to install the kiosktool package (which is not installed by default). Once it's installed, launch kiosktool from the main KDE menu using System → Configuration → Kiosk Admin Tool. To use kiosktool, you begin by defining KDE profiles (a profile is basically a collection of KDE settings), and then you assign profiles to users. From the main menu of kiosktool, you can modify the existing profiles or add new ones. There are four predefined profiles:
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Configure the GNOME Desktop
Of the dozen or more desktops available for Linux, KDE and GNOME are the most mature and are certainly the only two that are decently supported and configured in SUSE Linux. Some Linux distributions (or distros) are strongly biased in favor of one or the other; for example, Ubuntu Linux strongly favors GNOME. My impression is that SUSE favors KDE, but only by a small margin. There is little point in attempting a reasoned discussion about whether KDE or GNOME is better. They're both very good, both well styled, both highly customizable, and both will let you get the job done. I will confess a personal preference for KDE, but that's probably only because I know it better than GNOME.
Overall, GNOME perhaps has a cleaner and simpler look than KDE. By default, Gnome uses two panels (task bars) instead of KDE's one: one across the top edge of the screen and one across the bottom. (However, in SUSE 10.1, the default setup has no task bar along the top edge.) By default, the top panel carries the menus and the launch icons; the bottom panel carries the window list and the virtual workspace switcher. (I keep saying "by default" because, like KDE, GNOME is endlessly customizable, which is the purpose of this lab.)
Instead of the single main menu in KDE, there are (since GNOME version 2.10) three menus on the top panel: Applications, Places, and Desktop. Applications lists all the GNOME applications. Places has links to the user's home folder, the desktop, bookmarks, all removable devices (which are mounted), network servers, and the recently used files list. Places also lets you search for files and connect to remote servers. The Desktop menu consists of submenus for desktop configuration and entries for logging off, locking the screen, and so on. (If you prefer a single menu closer to the KDE style, you can add the main GNOME menu to the panel as described next.)
To configure either the top or bottom panel, right-click on the panel and select Properties. From the panel properties dialog, you can:
  • Change the size of the panel.
  • Add hide buttons or turn on auto-hiding.
  • Set the background and transparency of the panel. (Personally, I can't get too excited about transparency on the desktop. Maybe I'm getting old.)
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Play Audio and Video
Because I've grown up in an environment of "scientific" computing (and in an era when CPU cycles were always in short supply), the idea of using a computer for anything so frivolous as playing music or movies would never have occurred to me. Times have changed. In this lab, you'll learn how you can use SUSE Linux to play and manipulate digital audio and video content.
Not all of the software you'll need to turn SUSE Linux into a capable multimedia player is included in the standard distribution. If you are running SUSE Linux 9.3, there's a multimedia option pack that you should install. It is available via YOU (YaST Online Update). There is no multimedia option pack for 10.0 or 10.1. However, you might want to visit the Packman site (for SUSE 10.0, the URL is http://packman.iu-bremen.de/suse/10.0), where you will find a number of multimedia packages. You'll learn about installing packages with YOU in Chapter 5.
Playing audio CDs on SUSE Linux is a bit of a no-brainer. If you insert an audio CD, SUSE Linux should auto-detect it and offer to start the player KsCD. If it doesn't, you can start the player manually by selecting Multimedia → CD Player → KsCD from the main KDE menu.
This player is easy to use; to describe its user interface would be to insult your intelligence. The only slightly nonobvious feature is a drop-down list at the top of the KsCD screen that gives access to the track list. If you have an Internet connection, the player will automatically contact a CDDB server to obtain a track list for your CD. (Go to Extras → Configure KsCD → CDDB to select a server; the default is freedb.freedb.org.) Track lists are cached in the ~/.cddb folder.
The GNOME CD player, gnome-cd, is also available, and has, if anything, an even cleaner user interface. (Select Multimedia → CD Player → CD Player from the main KDE menu.)

Section 3.7.1.1: To rip an audio CD

For "ripping" CDs (i.e., converting the tracks into encoded audio files), use Grip. (Select Multimedia → CD/DVD tools → Grip from the main KDE menu.) Actually, Grip also functions fine as a CD player, but ripping is its main purpose. If you do not see it on the menu, try installing the Grip RPM. Grip uses a hierarchical organization of screens with a row of tabs at each level, which makes it difficult to navigate until you get used to it. I would have preferred a tree view control.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Burn Your Own CDs and DVDs
Burning CDs and DVDs can be useful as a convenient and cheap form of backup, as a way of producing audio or video discs for home entertainment use, or even to produce your own Linux distribution. There are (of course) quite a number of CD-writing tools for Linux. Most of them are basically graphical frontends to the underlying command-line tools, which we'll discuss later in this lab. This lab looks at K3b, one of the best of these tools. K3b is available from the main KDE menu at Multimedia → CD/DVD burning → K3b.
We'll look at five tasks: creating a data CD, creating an audio CD, burning a CD from an existing ISO image, copying a CD, and creating an ISO image from a CD.

Section 3.8.1.1: To create a data CD

Launch K3b and select File → New Project → New Data CD Project from the menu. The Current Project window will open in the lower half of the screen. You may now navigate the filesystem and drag the files or folders that you want to include on your CD into the Current Project window. A green progress bar across the bottom of the screen shows how much space will be used on your CD. When you've completed adding files to the project, click on Burn. (If you think you're likely to want to burn the same set of files to CD again, save the project using File → Save As from the menu.) Projects are stored as XML text in zipped files with the extension .k3b. The Burn screen offers many configurable settings under five tabs. Most of these can be left alone. Settings you might want to consider changing are listed next.
On the Writing tab, you can:
  • Select the CD writer (if you have more than one).
  • Set the writing speed.
  • Turn off the "on the fly" option. This tells K3b to build the disk image before starting to write it, and might be helpful on older, slower machines.
  • Turn on the "Only create image" option. This tells K3b to create an ISO image of the CD rather than actually burn one. You might want to do this to put the image onto a web site, for example. Note that you can subsequently do a loopback mount on the ISO image with a command something like:
    # mount -o loop mycdimage.iso /mnt
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Capture Screenshots
Content pr