Basic Linux Administration

In Chapters 9 through 14 , we covered a number of administrative commands. These commands help you manage your Linux system. Some enable you to manage users and groups. Others allow you to work with packages like those you might find in an RPM or a tarball. Some of these packages have to be compiled before they can be installed.

Other important administrative commands help you run through the boot process or set up jobs, such as backups , that can be run in the middle of the night.

User and Group Commands

Commands that help you administer users and groups are briefly described in Table A.11. Some allow you to create users and groups; others let you configure them for the Shadow Password Suite. For more information on these commands, refer to Chapter 09 .

Table A.11: User and Group Administrative Commands

Command

Function

chage option user

Depending on the option, sets the life of a user s password or account.

grpconv

Converts passwords in /etc/group and stores them in /etc/gshadow .

grpunconv

Reverses the grpconv process, restoring passwords to /etc/group .

newusers file

Adds new users from a list in file .

pwconv

Converts passwords in /etc/passwd and stores them in /etc/shadow .

pwunconv

Reverses the pwconv process, restoring passwords to /etc/group .

useradd name

Adds a new user with name .

userdel name

Deletes a user with name; use the -r option if you also want to delete that user s home directory.

Modifying User and Group Access

Users and group access can be limited by quotas. A quota limits the number or size of available files. You can organize group access in a specific directory by using the User Private Group scheme. We ve listed the relevant commands in Table A.12. For more information on these commands, refer to Chapter 09 .

Table A.12: User and Group Access Commands

Command

Function

edquota user

Opens a quota configuration file for the user .

grpquota group

Opens a quota configuration file for the group .

quotacheck

Creates base quota configuration files; usually run with the -avum options.

quotaon filesystem

Activates quotas for a specific filesystem, such as /home .

Package Management

Red Hat Linux lets you install packages from RPMs or tarballs. You can install RPM packages with the appropriate rpm command; we covered this command in detail in Chapter 10 . Tarballs are a little more problematic ; they must first be uncompressed and unpackaged. A good example of this process is shown in Chapter 12 , using the Linux kernel.

Generally , once you ve installed an RPM package, it s ready for use. You might have to activate it with a command such as chkconfig , but all the components are there in the correct locations.

However, uncompressing and unpacking a tarball is not enough. For example, if you were to download a newprogram.tar.gz package from the Internet, you could uncompress and unpack it with a command like the following:

 # tar xzvf newprogram.tar.gz 

This command sets up a series of files in some directory, probably something like newprogram . There is generally a README file in this directory containing installation instructions. Sometimes there s a script, such as install.pl , that s ready for use. Alternatively, you might have to edit settings and then compile the program.

To compile a program, first navigate to the program directory. Sometimes it s enough to edit the appropriate configuration file, navigate to the right directory, and then run the make command. However, the situation could be more complex, and you might have to use commands like make mrproper , make modules , and make modules_install for the kernel, as described in Chapter 12 .

Boot Process Commands

Commands that manage the boot process are briefly described in Table A.13. These commands are hard to classify. Some check boot messages; others use parts of the boot process. For more information on these commands, refer to Chapter 11 .

Table A.13: Boot Process Commands

Command

Description

dmesg

Lists the boot messages, normally stored in the kernel ring buffer; alternatively, you can check the end of /var/log/messages for the same information.

grub-install

Installs GRUB as the bootloader; designed to convert your system from another bootloader, such as LILO.

init runlevel

Specifies a new runlevel; helps you test a new configuration or enter single-user mode for troubleshooting.

initdefault

Specifies the default runlevel in /etc/inittab .

kudzu

Starts the Red Hat Linux hardware configuration utility, which normally runs automatically when you install or remove hardware.

mkbootdisk version

Creates a customized boot disk based on the specified kernel version from the /boot directory.

Administrative Commands

Table A.14 explains some important administrative commands that help you manage your system conveniently. For example, the cron and at daemons allow you to schedule operations when they won t interfere with user activity, such as during the middle of the night. For more information on these commands, refer to Chapter 13 .

Table A.14: Administrative Commands

Command

Description

at file time

A onetime command for executing a job or program; closely related to atq , atrm , and batch .

atq

A query to the current list of at jobs.

atrm job

A command that removes a job from the queue.

batch file

A specialized at job that normally runs when the demand on the CPU is below 80% of capacity.

crontab

A command that opens a file where you can configure jobs to be run at regular intervals.

kill PID

A command that stops the process with the given PID.

logrotate

A cron job that rotates log files on a regular basis; by default, it s in the /etc/cron.daily directory.

nice -n number command

A command that starts another command with a lower priority.

ps

A command that lists running processes. The x option lists processes for all users; many other options are available.

renice PID

A command that raises the priority of a process with the given PID.

tmpwatch

A cron job that erases /tmp and /var/tmp files on a regular basis; by default, it s in the /etc/cron.daily directory.

top

A utility that dynamically displays processes that require the most CPU resources.

who

A command that lists logged-on users.

Backup Commands

Other important commands (shown in Table A.15) are related to backing up the data on your system. Some allow you to back up and restore data directly, or you can set up a RAID array that provides data redundancy. For more information on these commands, see Chapter 14 .

Table A.15: Backup Commands

Command

Description

cdrecord options file

Copies a file, often an .iso file, to a recordable CD on an appropriate drive.

dump type device directory

Backs up a directory to a device using a certain type of backup.

dvdrecord options file

Copies a file, often an .iso file, to a recordable DVD on an appropriate drive.

cpio

Takes input from a list (such as from a find command) and copies it to standard output, which can be directed to a file such as backedup.cpio .

mkisofs options new.iso directory

Creates a new.iso file from the files in a directory based on options .

mkraid

Creates a RAID device based on criteria defined in /etc/raidtab .

restore

Restores from a backup created with dump .

tar

Archives from a group of files into one tape archive file.

 


Mastering Red Hat Linux 9
Building Tablet PC Applications (Pro-Developer)
ISBN: 078214179X
EAN: 2147483647
Year: 2005
Pages: 220

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net