System Administration Utilities


System Administration Utilities

This section briefly describes a few of the many utilities that can help you perform system administration tasks. Some of these utilities are incorporated as part of the Main menu, and some are useful to users other than the system administrator.

Red Hat Configuration Tools

Most of the Red Hat configuration tools are named system-config-*. Many of these tools bring up a graphical display when called from a GUI and a textual display when called from a non-GUI command line. In general, these tools, which are listed in , are simple to use and require little explanation beyond what the tool presents. Some have Help selections on their toolbar; most do not have man pages.

Table 11-2. Red Hat configuration tools

Tool

Function

system-config-authentication

Displays the Authentication Configuration window with two tabs: User Information and Authentication. The User Information tab allows you to enable NIS, LDAP, Hesiod, and Winbind support. The Authentication tab allows you to use shadow and MD5 (page ) passwords as well as to enable LDAP, Kerberos, SMB, and Winbind support.

system-config-bind (FEDORA)

Displays the Domain Name Service window. For more information see page .

system-config-boot

Displays the Boot Configuration window, which allows you to specify which boot entry in /etc/grub.conf (page ) the system should boot from.

system-config-date

Displays the Date/Time Properties window with two tabs: Date & Time and Time Zone. You can set the date and time or enable NTP (Network Time Protocol) from the first tab. The Time Zone tab allows you to specify the time zone of the system clock or set the system clock to UTC (page ).

system-config-display

Brings up the Display Settings window with three tabs: Settings, Hardware, and Dual Head. For more information see page .

system-config-httpd

Displays the HTTP window with four tabs: Main, Virtual Hosts, Server, and Performance Tuning. For more information see page .

system-config-keyboard

Displays the Keyboard window, which allows you to select the type of keyboard attached to the system. You use this utility to select the keyboard when you install the system.

system-config-kickstart

Displays the Kickstart Configurator window, which allows you to create a Kickstart script. For more information see page .

system-config-language

Displays the Language Selection window, which allows you to specify the default system language from among those that are installed. You use this utility to select the system language when you install the system.

system-config-lvm

Displays the Logical Volume Management window, which allows you to modify existing logical volumes. For more information see page .

system-config-mouse (RHEL)

Displays the Mouse Configuration window, which allows you to specify the type of mouse that is attached to the system. You use this utility to select the system mouse when you install the system.

system-config-netboot

Displays the Network Installation and Diskless Environment window, which allows you to configure the network installation or a diskless environment. The first time you run this utility, it displays the First Time Druid window.

system-config-network

Displays the Network Configuration window. For more information see page .

system-config-network-cmd

Displays the parameters that system-config-network uses.

system-config-nfs

Displays the NFS Server Configuration window. For more information see page .

system-config-packages (RHEL)

Displays the Package Management window. You use this utility to customize the list of packages you install when you install the system.

system-config-printer

Displays the Printer Configuration window, which allows you to set up printers and edit printer configurations. For more information see page .

system-config-rootpassword

Displays the Root Password window, which allows you to change the root password. While logged in as root, you can also use passwd from a command line to change the root password.

system-config-samba

Displays the Samba Server Configuration window, which can help you configure Samba. For more information see page .

system-config-securitylevel

Displays the Security Level Configuration window with two tabs: Firewall Options (page ) and SELinux (page ).

system-config-services

Displays the Service Configuration window, which allows you to specify which daemons (services) run at each runlevel. For more information see page .

system-config-soundcard

Displays the Audio Devices window, which tells you which audio device the system detected and gives you the option of playing a sound to test the device.

system-config-users

Displays the User Manager window, which allows you to work with users and groups. For more information see page .

system-logviewer (RHEL)

Displays the System Logs window, which can display various system logs.

system-switch-mail

Displays the system-switch-mail window, which allows you to choose between the sendmail (page ) and Postfix (page ) MTAs.


If the tool is not present on your system, use yum (page ) on FEDORA systems or RHN (page ) on RHEL systems to install it.

Command Line Utilities

This section describes a few command line system administration tools you may find useful. To learn more about most of these utilities, read the man pages. For umask and uname, see the info pages.

chsh

Changes the login shell for a user. When you call chsh without an argument, you change your own login shell. Superuser can change the shell for any user by calling chsh with that user's username as an argument. When changing a login shell with chsh, you must specify an installed shell that is listed in the file /etc/shells; other entries are rejected. Also, you must give the pathname to the shell exactly as it appears in /etc/shells. The chsh list-shells command displays the list of available shells. In the following example, Superuser changes Sam's shell to tcsh:

# chsh sam
Changing shell for sam.
New shell [/bin/bash]: /bin/tcsh
Shell changed.

clear

Clears the screen. You can also use CONTROL-L from the bash shell to clear the screen. The value of the environment variable TERM (page ) is used to determine how to clear the screen.

dmesg

Displays recent system log messages (page ).

e2label

Displays or creates a volume label on an ext2 or ext3 disk partition. An e2label command has the following format:


e2label device [newlabel]

where device is the name of the device (/dev/hda2, /dev/sdb1, /dev/fd0, and so on) you want to work with. When you include the optional newlabel parameter, e2label changes the label on device to newlabel. Without this parameter, e2label displays the label. You can also create a volume label with the L option of tune2fs (page ).

kudzu

Finds new and changed hardware and configures it. This utility determines which hardware is new by probing all devices on internal and external buses and comparing the results to the /etc/sysconfig/hwconf database. In the default configuration, the /etc/rc.d/init.d/kudzu script runs and calls kudzu as the machine enters runlevels 3 and 5. When it finds new or changed hardware, kudzu gives you a chance to configure it and permits you to deconfigure any hardware that you have removed.

mkfs

Creates a new filesystem on a device. This utility is a front end for many utilities, each of which builds a different type of filesystem. By default, mkfs builds an ext2 filesystem and works on either a hard disk partition or a floppy diskette. Although it can take many options and arguments, you can use mkfs simply as

# mkfs device

where device is the name of the device (/dev/hda2, /dev/sdb1, /dev/fd0, and so on) you want to make a filesystem on. Use the t option to specify a type of filesystem. The following command creates an ext3 filesystem on device:

# mkfs -t ext3 device

ping

Sends packets to a remote system. This utility determines whether you can reach a remote system through the network and determines how much time it takes to exchange messages with the remote system. Refer to "" on page .

reset (link to tset)

Resets terminal characteristics. The value of the environment variable TERM (page ) determines how to reset the screen. The screen is cleared, the kill and interrupt characters are set to their default values, and character echo is turned on. From a graphical terminal emulator, this command also changes the size of the window to its default. The reset utility is useful to restore your screen to a sane state after it has been corrupted. It is similar to an stty sane command.

setserial

Gets and sets serial port information. Superuser can use this utility to configure a serial port. The following command sets the input address of /dev/ttys0 to 0x100, the interrupt (IRQ) to 5, and the baud rate to 115,000 baud:

# setserial /dev/ttys0 port 0x100 irq 5 spd_vhi

You can also check the configuration of a serial port with setserial:

# setserial /dev/ttys0
/dev/ttyS0, UART: 16550A, Port: 0x0100, IRQ: 5, Flags: spd_vhi

Normally, setserial is called when the system is booting if a serial port needs custom configuration.

stat

Displays information about a file or filesystem. The f (filesystem) option followed by the device name or mount point of a filesystem displays information about the filesystem including the maximum length of filenames (Namelen in the following example). See the stat man page for more information.

$ stat -f /dev/hda
  File: "/dev/hda"
    ID: 0        Namelen: 255     Type: tmpfs
Block size: 4096       Fundamental block size: 4096
Blocks: Total: 121237     Free: 121206     Available: 121206
Inodes: Total: 121237     Free: 120932

umask

A shell builtin that specifies a mask the system uses to set up access permissions when you create a file. A umask command has the following format:


umask [mask]

where mask is a three-digit octal number or a symbolic value such as you would use with chmod (page ). The mask specifies the permissions that are not allowed. When mask is an octal number, the digits correspond to the permissions for the owner of the file, members of the group the file is associated with, and everyone else. Because mask specifies the permissions that are not allowed, the system subtracts each of the three digits from 7 when you create a file. The result is three octal numbers that specify the access permissions for the file (the numbers you would use with chmod). A mask that you specify using symbolic values specifies the permissions that are allowed.

Most utilities and applications do not attempt to create files with execute permissions, regardless of the value of mask; they assume you do not want an executable file. As a result, when a utility or application (such as touch) creates a file, the system subtracts each of the three digits in mask from 6. An exception is mkdir, which assumes that you want the execute (access in the case of a directory) bit set.

The following commands set the file-creation permissions mask and display the mask and its effect when you create a file and a directory. The mask of 022, when subtracted from 777, gives permissions of 644 (rwrr) for a file and 755 (rwxr-xr-x) for a directory.

$ umask 022
$ umask
0022
$ touch afile
$ mkdir adirectory
$ ls -ld afile adirectory
drwxr-xr-x  2 sam sam 4096 May  2 23:57 adirectory
-rw-r--r--  1 sam sam    0 May  2 23:57 afile

The next example sets the same mask using symbolic values. The S option displays the mask symbolically:

$ umask u=rwx,g=rx,o=rx
$ umask
0022
$ umask -S
u=rwx,g=rx,o=rx

uname

Displays information about the system. Without any arguments, this utility displays the name of the operating system (Linux). With a a (all) option, it displays the operating system name, hostname, version number and release date of the operating system, and type of hardware you are using:

# uname a
Linux pbnj 2.6.15-1.1871_FC5 #1 Mon Jan 23 15:53:52 EST 2006 i686 athlon i386 GNU/Linux