Fundamental System Administration Tools Chapter 3
Chapter Goals To introduce reader to a few of the tools required to perform the duties of the system administrator. To introduce good practices for system administrators. File Tree navigation fundamentals. Introduction to the UNIX vi File Editor.
Fundamental Sysadmin Tasks The daily tasks performed by a system administrator require specialized as well as common tools.  System administration requires a way of working that is : craftsman-like,  strives for a working practice aimed at producing robust, secure, and reliable systems.  This chapter examines tools and practices common to many system administration tasks.
Fundamental Sysadmin Tasks System administrators are knowledgeable users of the systems they manage.  They need to know how to: navigate the file system,  use basic user-level tools,  use the ubiquitous  vi  editor,  combine commands using pipes,  employ a variety of graphical tools.  It is assumed for the purposes of this chapter that the reader has a basic knowledge of the Windows and UNIX user environments.
Good Practices Good working practices are the threads that tie together the tasks performed by the Sysadmin. Good practices make tasks easier to reproduce, preserve system security/robustness, and maintain system functionality. System administrator involves managing details.  Knowing how a system is configured, what patches have been applied, what services the system needs or provides, and any number of other items is a tremendous aid in solving problems.
Good Practices Another part of the job is continual learning.  Establishing a discipline of carrying out daily, weekly, and monthly tasks is necessary in maintaining systems, identifying slowly growing problems, and preparing for unexpected problems.
Good Practices     Avoid using  root  or  administrator  as much as possible. Use a less privileged account, for which mistakes will be less drastic.      Avoid using wildcard characters, such as the asterisk (*), when running as  root  or  administrator.        Make it a habit to create backup copies of files before you edit.       Allow plenty of time to complete the tasks you need to perform.
Moving Around the File Tree The most basic tasks of system administration involve the manipulation of file storage.  Understanding file system navigation tools, and being able to use them, are basic to managing a system. Both UNIX and Windows organize disk storage into a tree structure.  UNIX unifies all file storage space, disks, remote file systems, and entries for devices and communications end points into a single tree.  Windows takes the approach of creating a forest of trees, one for each disk or remote file system or share, with separate named entities (e.g.,  c:, lpt0 )
Moving Around the File Tree Files within the file trees can be referred to by their full path names, traversing the tree from the root to the leaf and listing each directory as it is passed.  Although providing the full path completely specifies the location of a file, it is more common to use a relative path; one that starts in your current location. Commands for traversal of the file tree: cd / chdir  Change Directory pwd  Show current location ls / dir   List the files and directories
Moving Around the File Tree A less common set of commands gathers and displays file system space statistics.  On UNIX systems, the  df  command reveals statistics concerning individual file systems in a system’s file tree, whereas the  du  command produces a list of the space consumed by directories.  On Windows systems this information is available using a graphical file tree viewer such as the explorer program or the web browser.
Why vi Despite the graphical tools available for many system administration tasks, on UNIX systems, many tasks require file editing.  Examples include maintenance of hosts and network files for networking, and of configuration files for daemons such as  inetd  and  init .  Few people really “love”  vi . However, it is frequently the only screen-oriented text editor available for managing a system.  Although not as easy to use as some editors,  vi  is widely available and should be accessible on any UNIX system.
Why vi Many editors cause problems when editing system files.  For example: Pico and emacs do not (by default) place a newline at the end of a line of text.  This causes many problems with editing files such as /etc/passwd, and other format sensitive configuration files.  These editors may not have access to all of the resources that they require when the system is in single user mode.
Power Tools There are a number of general tools and techniques that are more frequently used by system administrators than by users.  These include  command shell features,  graphical desktop tools,  programmable filters, and  scripting languages.  Many of these are available on both UNIX and Windows in one form or another, although most have their roots in the UNIX environment.
Power Tools pipes   - allow you to “pipe” the output of one command into another command as input. ps  (task manager) – allows you to view the system process table. The  ps  command differs a bit among UNIX variants. The two major divisions are the BSD-style and the System V-style. more/less  – pagination commands that allow you to view files one page at a time. grep  – Get Regular Expression – find a pattern in a file.
Power Tools tar  – create a tape archive of files. Programmable Filters Another class of tools that can be used with pipes or by themselves to massage a flow of data are programmable filters.  Two common examples of filters are  awk  and  sed .  awk uses an interpreted command language, and treats input as though it were a textual database. sed – the  s tream  ed itor, uses the regular expression language seen in  vi  and  grep,  and allows you to edit streams of input.
Power Tools find –  locate files by name, or file characteristics, or locate strings in files. perl –  a very powerful interpreted scripting language. cygwin –  a UNIX shell and utilities for use on Windows systems.
Juggling Multiple Tasks Juggling multiple tasks is a fact of life for a system administrator: Monitoring network and system performance  dealing with a never-ending stream of e-mail searching the web for information remotely accessing several systems  Modern windowed environments help with juggling tasks by providing easily used graphical interfaces and tools for grouping related tasks.
Windowed Environments Both Windows and UNIX provide some form of windowed work environment.  Although these desktop environments all appear to be different, they have several common features that are of interest to the system administrator.  First, note that all desktops allow for multiple windows.  Switching back and forth between tasks or GUI tools is performed by mouse click or keyboard shortcut.
Windowed Environments Second, all desktops offer terminal emulation, providing multiple command line interfaces.  Multiple terminal windows are often used for connections to remote systems or to edit a configuration file while using another terminal window to test the configuration. Third, idle tasks can be reduced to icons or entries on a task management menu for easy access.  Fourth, UNIX desktops provide a facility for switching between multiple virtual screens. There are add-on tools for the Windows desktops that facilitate the  virtual screen facility.
General-purpose GUI Tools E-mail Most system administrators handle a large volume of e-mail each day. A powerful mail agent is a requirement for dealing with this flood of information.  A good mail agent for a system administrator should include filtering tools, for automating the task of sorting mail, and an easily navigated filing and searching system.  Some recent mail agents are GUI based and make it easier to fully use their filtering and navigation features.
General-purpose GUI Tools Web Browsers A vast amount of useful system administration information is available on the Internet and viewable via a web browser.  Most UNIX and Windows platforms offer several web browsers, such as the popular Internet Explorer and Netscape Navigator.  For basic information, viewing and downloading of files, nearly any web browser will work. However, a browser that integrates graphics and PDF file viewing allows a wider range of information to be viewed.
General-purpose GUI Tools Virtual Terminal Perhaps the most common use of a windowed environment is a setup of multiple-terminal windows, connected to multiple systems.  Terminal windows have several advantages over an ordinary terminal:  Terminal windows provide variable scroll-back capabilities that provide easy review of output.  Terminal windows can emulate various terminals, allowing a single workstation to act in place of one or more special-purpose terminals.  Terminal windows also allow for easy transfer of small bits of text and command strings by incorporating “cut and paste” capabilities.
General-purpose GUI Tools Spreadsheet Spreadsheets can be used effectively to automate a number of recordkeeping tasks.  Typical uses of a spreadsheet are as a table of data that can be sorted and searched and as a progress checklist for larger tasks.
Summary The fundamental tools of system administration include: careful and systematic work habits  a selection of basic software tools.  editors, filters,  file system navigation windowed environments power tools

Ch03 system administration

  • 1.
  • 2.
    Chapter Goals Tointroduce reader to a few of the tools required to perform the duties of the system administrator. To introduce good practices for system administrators. File Tree navigation fundamentals. Introduction to the UNIX vi File Editor.
  • 3.
    Fundamental Sysadmin TasksThe daily tasks performed by a system administrator require specialized as well as common tools. System administration requires a way of working that is : craftsman-like, strives for a working practice aimed at producing robust, secure, and reliable systems. This chapter examines tools and practices common to many system administration tasks.
  • 4.
    Fundamental Sysadmin TasksSystem administrators are knowledgeable users of the systems they manage. They need to know how to: navigate the file system, use basic user-level tools, use the ubiquitous vi editor, combine commands using pipes, employ a variety of graphical tools. It is assumed for the purposes of this chapter that the reader has a basic knowledge of the Windows and UNIX user environments.
  • 5.
    Good Practices Goodworking practices are the threads that tie together the tasks performed by the Sysadmin. Good practices make tasks easier to reproduce, preserve system security/robustness, and maintain system functionality. System administrator involves managing details. Knowing how a system is configured, what patches have been applied, what services the system needs or provides, and any number of other items is a tremendous aid in solving problems.
  • 6.
    Good Practices Anotherpart of the job is continual learning. Establishing a discipline of carrying out daily, weekly, and monthly tasks is necessary in maintaining systems, identifying slowly growing problems, and preparing for unexpected problems.
  • 7.
    Good Practices    Avoid using root or administrator as much as possible. Use a less privileged account, for which mistakes will be less drastic.     Avoid using wildcard characters, such as the asterisk (*), when running as root or administrator.     Make it a habit to create backup copies of files before you edit.     Allow plenty of time to complete the tasks you need to perform.
  • 8.
    Moving Around theFile Tree The most basic tasks of system administration involve the manipulation of file storage. Understanding file system navigation tools, and being able to use them, are basic to managing a system. Both UNIX and Windows organize disk storage into a tree structure. UNIX unifies all file storage space, disks, remote file systems, and entries for devices and communications end points into a single tree. Windows takes the approach of creating a forest of trees, one for each disk or remote file system or share, with separate named entities (e.g., c:, lpt0 )
  • 9.
    Moving Around theFile Tree Files within the file trees can be referred to by their full path names, traversing the tree from the root to the leaf and listing each directory as it is passed. Although providing the full path completely specifies the location of a file, it is more common to use a relative path; one that starts in your current location. Commands for traversal of the file tree: cd / chdir Change Directory pwd Show current location ls / dir List the files and directories
  • 10.
    Moving Around theFile Tree A less common set of commands gathers and displays file system space statistics. On UNIX systems, the df command reveals statistics concerning individual file systems in a system’s file tree, whereas the du command produces a list of the space consumed by directories. On Windows systems this information is available using a graphical file tree viewer such as the explorer program or the web browser.
  • 11.
    Why vi Despitethe graphical tools available for many system administration tasks, on UNIX systems, many tasks require file editing. Examples include maintenance of hosts and network files for networking, and of configuration files for daemons such as inetd and init . Few people really “love” vi . However, it is frequently the only screen-oriented text editor available for managing a system. Although not as easy to use as some editors, vi is widely available and should be accessible on any UNIX system.
  • 12.
    Why vi Manyeditors cause problems when editing system files. For example: Pico and emacs do not (by default) place a newline at the end of a line of text. This causes many problems with editing files such as /etc/passwd, and other format sensitive configuration files. These editors may not have access to all of the resources that they require when the system is in single user mode.
  • 13.
    Power Tools Thereare a number of general tools and techniques that are more frequently used by system administrators than by users. These include command shell features, graphical desktop tools, programmable filters, and scripting languages. Many of these are available on both UNIX and Windows in one form or another, although most have their roots in the UNIX environment.
  • 14.
    Power Tools pipes - allow you to “pipe” the output of one command into another command as input. ps (task manager) – allows you to view the system process table. The ps command differs a bit among UNIX variants. The two major divisions are the BSD-style and the System V-style. more/less – pagination commands that allow you to view files one page at a time. grep – Get Regular Expression – find a pattern in a file.
  • 15.
    Power Tools tar – create a tape archive of files. Programmable Filters Another class of tools that can be used with pipes or by themselves to massage a flow of data are programmable filters. Two common examples of filters are awk and sed . awk uses an interpreted command language, and treats input as though it were a textual database. sed – the s tream ed itor, uses the regular expression language seen in vi and grep, and allows you to edit streams of input.
  • 16.
    Power Tools find– locate files by name, or file characteristics, or locate strings in files. perl – a very powerful interpreted scripting language. cygwin – a UNIX shell and utilities for use on Windows systems.
  • 17.
    Juggling Multiple TasksJuggling multiple tasks is a fact of life for a system administrator: Monitoring network and system performance dealing with a never-ending stream of e-mail searching the web for information remotely accessing several systems Modern windowed environments help with juggling tasks by providing easily used graphical interfaces and tools for grouping related tasks.
  • 18.
    Windowed Environments BothWindows and UNIX provide some form of windowed work environment. Although these desktop environments all appear to be different, they have several common features that are of interest to the system administrator. First, note that all desktops allow for multiple windows. Switching back and forth between tasks or GUI tools is performed by mouse click or keyboard shortcut.
  • 19.
    Windowed Environments Second,all desktops offer terminal emulation, providing multiple command line interfaces. Multiple terminal windows are often used for connections to remote systems or to edit a configuration file while using another terminal window to test the configuration. Third, idle tasks can be reduced to icons or entries on a task management menu for easy access. Fourth, UNIX desktops provide a facility for switching between multiple virtual screens. There are add-on tools for the Windows desktops that facilitate the virtual screen facility.
  • 20.
    General-purpose GUI ToolsE-mail Most system administrators handle a large volume of e-mail each day. A powerful mail agent is a requirement for dealing with this flood of information. A good mail agent for a system administrator should include filtering tools, for automating the task of sorting mail, and an easily navigated filing and searching system. Some recent mail agents are GUI based and make it easier to fully use their filtering and navigation features.
  • 21.
    General-purpose GUI ToolsWeb Browsers A vast amount of useful system administration information is available on the Internet and viewable via a web browser. Most UNIX and Windows platforms offer several web browsers, such as the popular Internet Explorer and Netscape Navigator. For basic information, viewing and downloading of files, nearly any web browser will work. However, a browser that integrates graphics and PDF file viewing allows a wider range of information to be viewed.
  • 22.
    General-purpose GUI ToolsVirtual Terminal Perhaps the most common use of a windowed environment is a setup of multiple-terminal windows, connected to multiple systems. Terminal windows have several advantages over an ordinary terminal: Terminal windows provide variable scroll-back capabilities that provide easy review of output. Terminal windows can emulate various terminals, allowing a single workstation to act in place of one or more special-purpose terminals. Terminal windows also allow for easy transfer of small bits of text and command strings by incorporating “cut and paste” capabilities.
  • 23.
    General-purpose GUI ToolsSpreadsheet Spreadsheets can be used effectively to automate a number of recordkeeping tasks. Typical uses of a spreadsheet are as a table of data that can be sorted and searched and as a progress checklist for larger tasks.
  • 24.
    Summary The fundamentaltools of system administration include: careful and systematic work habits a selection of basic software tools. editors, filters, file system navigation windowed environments power tools

Editor's Notes

  • #6 If you are new to the systems you are managing, a first step is to get a laboratory-style notebook and make a map of your network and an inventory of the systems. This map does not need to be complete at the start, but you should create it with an eye toward adding information as you go along. The type of information you keep depends somewhat on your environment, but basic network and system configuration data are a good start. Along the way, you will want to add system-specific quirks, such as odd potential problems or unusual things that need to be done when a system is rebooted. A list of local system modifications and installation procedures should form another section of your system administrator’s notebook. Careful organization can help keep system modifications corralled into manageable areas, but some system configuration information will need to be changed and reinstalled when a system is upgraded. Local installation customs and procedures will also need to be noted, not only for your use but for their use in teaching others and delegating tasks.
  • #7 System administration is a rapidly evolving field. New tools and new versions of tools appear daily. Security threats and techniques to thwart them are continually changing. Reading books, such as this one and those listed in each chapter’s “References” section, is good a place to start. Short courses and technical conferences offer another avenue for education on current topics. Among the best of these are offered by the USENIX organization in concert with the System Administrator’s Guild (SAGE), and by the System Administration Network Security Institute (SANS). Contact information for both of these organizations is found in the “Reference” section at the end of this chapter.
  • #11 The graphical user interface (GUI) that is common today originally came from systems developed at Xerox’s Palo Alto Research Center. The Xerox Star was an early office system with overlapping windows, mouse pointer, and WYSIWYG text editing. Although the Star did not survive in the marketplace, it was seen by Steve Jobs (of Apple) on a visit to PARC. Inspired by the Star, Apple produced the LISA and Macintosh, bringing the GUI to a wide market.
  • #15 One of the fundamental design ideas in the UNIX command line interface is the modular combination of basic commands. Many UNIX commands were designed to allow them to be flexibly combined to process or filter information as it is passed from command to command. The vertical bar character, called a pipe, is used to form the connection between commands. Data flows from left to right between commands.
  • #16 One of the fundamental design ideas in the UNIX command line interface is the modular combination of basic commands. Many UNIX commands were designed to allow them to be flexibly combined to process or filter information as it is passed from command to command. The vertical bar character, called a pipe, is used to form the connection between commands. Data flows from left to right between commands. NOTE: When creating archives using tar , be aware that the path given to tar for the files or directories being archived is saved in the archive, along with the files and directories. If a full path is given (e.g., /home/dwight/AudioBooks ), older versions of tar will not be able to extract the files and directories in any location other than the path they were archived from. Although modern tar commands have the ability to get around this using an option flag, it is a good habit to use a relative path, as demonstrated in the previous example. Archives created with a relative path can be extracted in any location.
  • #17 One of the fundamental design ideas in the UNIX command line interface is the modular combination of basic commands. Many UNIX commands were designed to allow them to be flexibly combined to process or filter information as it is passed from command to command. The vertical bar character, called a pipe, is used to form the connection between commands. Data flows from left to right between commands. NOTE: When creating archives using tar , be aware that the path given to tar for the files or directories being archived is saved in the archive, along with the files and directories. If a full path is given (e.g., /home/dwight/AudioBooks ), older versions of tar will not be able to extract the files and directories in any location other than the path they were archived from. Although modern tar commands have the ability to get around this using an option flag, it is a good habit to use a relative path, as demonstrated in the previous example. Archives created with a relative path can be extracted in any location. NOTE: One of the most important aspects of the Windows versions of perl and UNIX-like toolkits for Windows is their use in remote system administration. Command line tools such as these can be used remotely to perform basic administration tasks that would ordinarily need to be performed from the Windows console.
  • #21 As mentioned, information on GUI tools and windowed desktop environments is incorporated where it relates to the task at hand. Most of the tools covered are specific to a given task. However, there are several general-purpose GUI tools a system administrator should be aware of.