Linux in a NutshellLinux in a NutshellSearch this book

Chapter 2. System and Network Administration Overview

Contents:

Common Commands
Overview of Networking
Overview of TCP/IP
Overview of Firewalls and Masquerading
Overview of NFS
Overview of NIS
Administering NIS
RPC and XDR

2.1. Common Commands

Following are lists of commonly used system administration commands.

2.1.1. Clocks

hwclock

Manage hardware clock.

rdate

Get time from network time server.

zdump

Print list of time zones.

zic

Create time conversion information files.

2.1.2. Daemons

apmd

Advanced Power Management daemon.

atd

Queue commands for later execution.

bootpd

Internet Boot Protocol daemon.

fingerd

Finger daemon.

ftpd

File Transfer Protocol daemon.

identd

Identify user running TCP/IP process.

imapd

IMAP mailbox server daemon.

inetd

Internet services daemon.

klogd

Manage syslogd.

lpd

Printer daemon.

mountd

NFS mount request server.

named

Internet domain name server.

nfsd

NFS daemon.

pppd

Maintain Point-to-Point Protocol (PPP) network connections.

rdistd

Remote file distribution server.

rexecd

Remote execution server.

rlogind

rlogin server.

routed

Routing daemon.

rpc.rusersd

Remote users server.

rpc.statd

NFS status daemon.

rshd

Remote shell server.

rwhod

Remote who server.

sshd

Secure shell daemon.

syslogd

System logging daemon.

talkd

Talk daemon.

tcpd

TCP network daemon.

tftpd

Trivial File Transfer Protocol daemon.

update

Buffer flush daemon.

ypbind

NIS binder process.

yppasswdd

NIS password modification server.

ypserv

NIS server process.

2.1.3. Hardware

agetty

Start user session at terminal.

arp

Manage the ARP cache.

cardctl

Control PCMCIA cards.

cardmgr

PCMCIA card manager daemon.

cfdisk

Maintain disk partitions (graphical interface).

fdisk

Maintain disk partitions.

hdparm

Get and set hard drive parameters.

kbdrate

Manage the keyboard's repeat rate.

ramsize

Print information about RAM disk.

setkeycodes

Change keyboard scancode-to-keycode mappings.

setserial

Set serial port information.

slattach

Attach serial lines as network interfaces.

2.1.4. Host Information

arch

Print machine architecture.

dig

Query Internet domain name servers. Replaces nslookup.

dnsdomainname

Print DNS domain name.

domainname

Print NIS domain name.

free

Print memory usage.

host

Print host and zone information.

hostname

Print or set hostname.

nslookup

Query Internet domain name servers. (Deprecated)

uname

Print host information.

2.1.5. Installation

cpio

Copy file archives.

install

Copy files into locations providing user access and set permissions.

rdist

Distribute files to remote systems.

tar

Copy files to or restore files from an archive medium.

2.1.6. Mail

fetchmail

Retrieve mail from remote servers.

formail

Convert input to mail format.

mailq

Print a summary of the mail queue.

makemap

Update sendmail's database maps.

rmail

Handle uucp mail.

sendmail

Send and receive mail.

2.1.7. Managing Filesystems

To Unix systems, a filesystem is a device (such as a partition) that is formatted to store files. Filesystems can be found on hard drives, floppies, CD-ROMs, or other storage media that permit random access.

The exact format and means by which the files are stored are not important; the system provides a common interface for all filesystem types that it recognizes. Under Linux, filesystem types include the Second Extended (ext2) Filesystem, which you probably use to store Linux files. This filesystem was developed primarily for Linux and supports 256-character filenames and 4-terabyte maximum filesystem size. (It is "second" because it is the successor to the extended filesystem type.) Other common filesystem types include the MS-DOS filesystem, which allows files on MS-DOS partitions and floppies to be accessed under Linux, and the ISO 9660 filesystem used by CD-ROMs.

The 2.4 kernel adds optional support for an enhanced version of the ext2 filesystem, the Third Extended (ext3) Filesystem. Many Linux distributions ship kernels with this support preconfigured. The ext3 filesystem is essentially an ext2 filesystem with an added journal. Since it is in all other ways identical to the ext2 system, it is both forward and backward compatible with ext2—all ext2 utilities work with ext3 filesystems. When the kernel interacts with an ext3 filesystem, writes to disk are first written to a log or journal before they are written to disk. This slows down writes to the filesystem, but reduces the risk of data corruption in the event of a power outage. It also speeds up reboots after a system unexpectedly loses power. When rebooting with an ext2 filesystem, the fsck utility scans the entire disk to ensure that all data blocks are listed as either used or free, that each data block is claimed by only one file or directory, and that all files are available in the directory tree. When rebooting an ext3 filesystem using a supported kernel, it need only check the journal and complete any tasks that were left uncompleted.

To change an ext2 filesystem into an ext3 filesystem, simply add a journal using the tune2fs utility with the -j option on the unmounted device. If the filesystem is listed in /etc/fstab, change its specified filesystem from ext2 to ext3, or auto (mountd will automatically detect the right system).

You can specify the level of journaling the kernel should use in the mount options field (or using mount -o). There are three data options:

data=journal
Log all filesystem data and metadata changes. All changes to the filesystem are written twice, once to the journal and once to the filesystem itself. This is the slowest but safest mode.

data=ordered
Log filesystem metadata. Flush data updates to disk before changing metadata. This is the default mode. This slows writes a small amount, but ensures the filesystem is always in sync with changes to its metadata.

data=writeback
Log filesystem metadata. Use the ext2 write process to write data changes. This is the fastest journaling mode. While it maintains filestructure integrity, the contents of files may contain old, stale data when the filesystem is restarted from an unexpected shutdown.

The last field in the /etc/fstab entry specifies at what point in the boot process the filesystem should be verified with fsck. It should never need to be checked because journaling ensures filesystem integrity. You can set this field to 0. You can also turn off the automatic check of the filesystem that normally occurs every 20th time the system is mounted using tune2fs -i 0 -c 0.

Although not covered in this edition of Linux in a Nutshell, Linux supports three other open source journaling filesystems: IBM's Journaled Filesystem (JFS), SGI's Extensible Filesystem (XFS), and the Naming System Venture's Reiser Filesystem (ReiserFS). In some situations these can be faster than ext3. Some Linux distributions use these alternative filesystems by default.

debugfs

Debug ext2 filesystem.

dosfsck

Check and repair a DOS or VFAT filesystem.

dumpe2fs

Print information about superblock and blocks group.

e2fsck

Check and repair an ext2 filesystem.

e2image

Store disaster recovery data for an ext2 filesystem.

fdformat

Format floppy disk.

fsck

Another name for e2fsck.

fsck.ext2

Check and repair an ext2 filesystem.

fsck.minix

Check and repair a MINIX filesystem.

fuser

List processes using a filesystem.

mke2fs

Make a new ext2 filesystem.

mkfs

Make new filesystem.

mkfs.ext2

Another name for mke2fs.

mkfs.ext3

Yet another name for mke2fs.

mkfs.minix

Make new MINIX filesystem.

mklost+found

Make lost+found directory.

mkraid

Set up a RAID device.

mkswap

Designate swap space.

mount

Mount a filesystem.

raidstart

Activate a RAID device.

raidstop

Turn off a RAID device.

rdev

Describe or change values for root filesystem.

resize2fs

Enlarge or shrink an ext2 filesystem.

rootflags

List or set flags to use in mounting root filesystem.

showmount

List exported directories.

swapoff

Cease using device for swapping.

swapon

Begin using device for swapping.

sync

Write filesystem buffers to disk.

tune2fs

Manage an ext2 filesystem.

umount

Unmount a filesystem.

2.1.8. Managing the Kernel

depmod

Create module dependency listing.

insmod

Install new kernel module.

lsmod

List kernel modules.

modinfo

Print kernel module information.

modprobe

Load new module and its dependent modules.

rmmod

Remove module.

sysctl

Examine or modify kernel parameters at runtime.

2.1.9. Networking

chat

Establish dial-up IP connections.

dip

Establish dial-up IP connections.

gdc

Administer gated routing daemon.

ifconfig

Manage network interfaces.

ipchains

Administer firewall facilities (2.2 kernel).

iptables

Administer firewall facilities (2.4 kernel).

named

Translate between domain names and IP addresses.

nameif

Assign names to network devices.

netstat

Print network status.

nfsstat

Print statistics for NFS and RPC.

nsupdate

Submit dynamic DNS update requests.

portmap

Map daemons to ports.

rarp

Manage RARP table.

route

Manage routing tables.

routed

Dynamically keep routing tables up to date.

rpcinfo

Report RPC information.

ruptime

Check how long remote system has been up.

rwho

Show who is logged into remote system.

traceroute

Trace network route to remote host.

2.1.10. Printing

checkpc

Examine and repair printer settings.

lpc

Control line printer.

tunelp

Tune the printer parameters.

2.1.11. Security and System Integrity

badblocks

Search for bad blocks.

chroot

Change root directory.

2.1.12. Starting and Stopping the System

bootpd

Internet Boot Protocol daemon.

bootpgw

Internet Boot Protocol gateway.

bootptest

Test bootpd.

halt

Stop or shut down system.

init

Change runlevel.

reboot

Shut down, then reboot system.

runlevel

Print system runlevel.

shutdown

Shut down system.

telinit

Change the current runlevel.

uptime

Display uptimes of local machines.

2.1.13. System Activity and Process Management

A number of additional commands in Chapter 3 are particularly useful in controlling processes, including kill, killall, killall5, pidof, ps, and who.

fuser

Identify processes using file or filesystem.

ipcrm

Remove interprocess communication message queue, semaphore array, or shared memory segment.

ipcs

Print interprocess communication information.

renice

Change the priority of running processes.

top

Show most CPU-intensive processes.

vmstat

Print virtual memory statistics and process statistics.

2.1.14. Users

chpasswd

Change multiple passwords.

groupadd

Add a new group.

groupdel

Delete a group

groupmod

Modify groups.

grpck

Check the integrity of group system files.

grpconv

Convert group file to shadow group file.

lastlog

Generate report of last user login times.

newusers

Add new users in a batch.

pwck

Check the integrity of password system files.

pwconv

Convert password file to shadow passwords.

rusers

Print who-style information on remote machines.

rwall

Print a message to remote users.

useradd

Add a new user.

userdel

Delete a user and that user's home directory.

usermod

Modify a user's information.

w

List logged-in users.

wall

Write to all users.

whoami

Show how you are currently logged in.

2.1.15. Miscellaneous

anacron

Schedule commands for periodic execution.

atrun

Schedule commands for later execution.

cron

Schedule commands for specific times.

dmesg

Print bootup messages after the system is up.

ldconfig

Update library links and do caching.

logger

Send messages to the system logger.

logrotate

Compress and rotate system logs.

run-parts

Run all scripts in a directory.



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.