Chapter 9. System Maintenance and Security

Now that you have your Ubuntu system up and running, it’s time to look at how you can keep it that way by taking the proper security precautions and maintaining your computer in tip-top condition.

Don’t worry that this chapter will be full of convoluted command-line statements and advanced Linux features, because you can actually do almost everything you need right from the desktop, with just a little mouse pointing and clicking.

Mostly, all you need to know is how to use a selection of programs and utilities that are accessible from Ubuntu’s menu system, and how to install a couple of others that aren’t. As you’ll soon see, it’s all quite easy.

Proper maintenance includes power management to limit unnecessary wear on components when the computer isn’t in use, configuring your preferred and startup applications, setting up how your removable media is treated, and various other system settings.

The place to find most of your maintenance and administration tasks is in the System Preferences menu (see Figure 9-1). Some of these programs offer fairly advanced options that you most likely won’t need, but there are half a dozen of them with which you should acquaint yourself.

I’ll run through these programs in the order in which they appear in the menu.

This program is useful for extending the product life of the components used by your PC, by giving you the ability to turn some or all off when the computer is idle.

It displays differently depending on whether you’re using a laptop or a desktop computer. Laptops will usually display items you won’t see for a desktop, such as a battery power tab.

Figure 9-2 shows what the window looks like on a laptop. On a desktop PC there is no On Battery Power tab and no ability to set the display brightness.

Using this window, you can choose the programs to use for the most common computing tasks, such as web browsing and reading email. Whenever one program has to call another—such as when you open an attachment in email or download a PDF in your browser—the system checks your preferred applications to make its choice. Figure 9-5 shows what the Preferred Applications window looks like when you call it up.

When Ubuntu boots up, there are a number of programs that get started by default, such as Bluetooth and network managers, the power manager, volume control, and so on (see Figure 9-7).

Using the Startup Applications utility, you can disable any of these or add new programs to the list using the Add, Remove, and Edit buttons. Remove and Edit will be grayed out until you select a program.

Be careful which programs you remove, as you could have difficulty restoring them if you need them later. The same goes for editing any of the default programs.

To add a program, click the Add button to bring up the dialog shown in Figure 9-8.

Here, I have chosen to add the program synergyc to run at startup. This is the client program of the Synergy utility, which lets me use a single keyboard and mouse on the computer named robin to operate all my Windows, OS X, and Ubuntu PCs. So now, each time this computer starts up, it will accept input from the robin computer’s keyboard and mouse. Chapter 10 offers more details on setting up and using this great little program.

If you don’t know a program’s name and/or location, you can click the Browse button and look for it.

The Window Preferences window allows you to control the way windows behave in conjunction with the mouse and keyboard (see Figure 9-10).

The window is divided into three main sections.

Moving on to the Administration menu next, there are several more maintenance options you may need.

In our house, we keep a Netbook PC in the living room so that we can look things up and check our email and social networking sites from time to time. We used to have just one account on it that we all shared, but we decided it was annoying to keep logging in and out and entering passwords in the web browser each time when changing users.

So, I decided to create a completely unsecure environment on this machine, because ease and speed of use were much more important to us than privacy and security, particularly since it never leaves the house.

The Netbook now has multiple users, each with empty passwords that the system automatically accepts. Any user can now click the User Switch icon at the top right of the desktop, and then choose a username from the list shown to automatically log in as that user. As long as the PC hasn’t been restarted, each of us now has all the programs we want open all the time, and which we can instantly return to—with all our settings and password details already entered.

If you want to create such a system, call up a Terminal window and then, for each user, enter the following:

sudo passwd -d username

The first time you do this you’ll need to enter your own password, but for the next 15 minutes you won’t be prompted. So, for example, if you have the users andy, brian, claire, and denise, you would enter the following:

sudo passwd -d andy
sudo passwd -d brian
sudo passwd -d claire
sudo passwd -d denise

This removes the password from all the users mentioned. You now need to edit a file to tell the system that users without passwords are allowed to log in automatically. To do this, enter the following:

sudo gedit /etc/pam.d/common-auth

The file will then be opened up in the editor, so move the cursor to the line (about 17 lines from the top) that looks like this:

auth    [success=1 default=ignore]    pam_unix.so nullok_secure

Now delete the _secure at the end of the line, click the Save button, log out, and enter your username to verify that you can now log in without a password. You will now have a completely open system, and even sudo commands will not require passwords.

The System Monitor is the place to go when you need to know how well your computer is handling its resources, such as memory, the network, hard disks, and so on. Figure 9-13 shows the program’s first tab, the System summary screen.